open-consul/proto/pbconnect/connect.go

80 lines
1.9 KiB
Go
Raw Normal View History

2022-03-16 16:12:29 +00:00
package pbconnect
import (
"github.com/hashicorp/consul/acl"
2022-03-16 16:12:29 +00:00
"github.com/hashicorp/consul/agent/structs"
"github.com/hashicorp/consul/proto/pbcommon"
2022-03-16 16:12:29 +00:00
)
func QueryMetaFrom(f structs.QueryMeta) *pbcommon.QueryMeta {
t := new(pbcommon.QueryMeta)
pbcommon.QueryMetaFromStructs(&f, t)
return t
2022-03-16 16:12:29 +00:00
}
func QueryMetaTo(f *pbcommon.QueryMeta) structs.QueryMeta {
t := new(structs.QueryMeta)
pbcommon.QueryMetaToStructs(f, t)
return *t
2022-03-16 16:12:29 +00:00
}
func RaftIndexFrom(f structs.RaftIndex) *pbcommon.RaftIndex {
t := new(pbcommon.RaftIndex)
pbcommon.RaftIndexFromStructs(&f, t)
return t
2022-03-16 16:12:29 +00:00
}
func RaftIndexTo(f *pbcommon.RaftIndex) structs.RaftIndex {
t := new(structs.RaftIndex)
pbcommon.RaftIndexToStructs(f, t)
return *t
2022-03-16 16:12:29 +00:00
}
func EnterpriseMetaFrom(f acl.EnterpriseMeta) *pbcommon.EnterpriseMeta {
t := new(pbcommon.EnterpriseMeta)
pbcommon.EnterpriseMetaFromStructs(&f, t)
return t
2022-03-16 16:12:29 +00:00
}
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
2022-03-16 16:12:29 +00:00
}