-
Notifications
You must be signed in to change notification settings - Fork 4.4k
/
connect.go
79 lines (66 loc) · 1.89 KB
/
connect.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package pbconnect
import (
"github.com/hashicorp/consul/acl"
"github.com/hashicorp/consul/agent/structs"
"github.com/hashicorp/consul/proto/pbcommon"
)
func QueryMetaFrom(f structs.QueryMeta) *pbcommon.QueryMeta {
t := new(pbcommon.QueryMeta)
pbcommon.QueryMetaFromStructs(&f, t)
return t
}
func QueryMetaTo(f *pbcommon.QueryMeta) structs.QueryMeta {
t := new(structs.QueryMeta)
pbcommon.QueryMetaToStructs(f, t)
return *t
}
func RaftIndexFrom(f structs.RaftIndex) *pbcommon.RaftIndex {
t := new(pbcommon.RaftIndex)
pbcommon.RaftIndexFromStructs(&f, t)
return t
}
func RaftIndexTo(f *pbcommon.RaftIndex) structs.RaftIndex {
t := new(structs.RaftIndex)
pbcommon.RaftIndexToStructs(f, t)
return *t
}
func EnterpriseMetaFrom(f acl.EnterpriseMeta) *pbcommon.EnterpriseMeta {
t := new(pbcommon.EnterpriseMeta)
pbcommon.EnterpriseMetaFromStructs(&f, t)
return t
}
func EnterpriseMetaTo(f *pbcommon.EnterpriseMeta) acl.EnterpriseMeta {
t := new(acl.EnterpriseMeta)
pbcommon.EnterpriseMetaToStructs(f, t)
return *t
}
func NewIssuedCertFromStructs(in *structs.IssuedCert) (*IssuedCert, error) {
t := new(IssuedCert)
IssuedCertFromStructsIssuedCert(in, t)
return t, nil
}
func NewCARootsFromStructs(in *structs.IndexedCARoots) (*CARoots, error) {
t := new(CARoots)
CARootsFromStructsIndexedCARoots(in, t)
return t, nil
}
func CARootsToStructs(in *CARoots) (*structs.IndexedCARoots, error) {
t := new(structs.IndexedCARoots)
CARootsToStructsIndexedCARoots(in, t)
return t, nil
}
func NewCARootFromStructs(in *structs.CARoot) (*CARoot, error) {
t := new(CARoot)
CARootFromStructsCARoot(in, t)
return t, nil
}
func CARootToStructs(in *CARoot) (*structs.CARoot, error) {
t := new(structs.CARoot)
CARootToStructsCARoot(in, t)
return t, nil
}
func IssuedCertToStructs(in *IssuedCert) (*structs.IssuedCert, error) {
t := new(structs.IssuedCert)
IssuedCertToStructsIssuedCert(in, t)
return t, nil
}