Documentation ¶
Index ¶
- func ComputeResolvedServiceConfig(args *structs.ServiceConfigRequest, entries *ResolvedServiceConfigSet, ...) (*structs.ServiceConfigResponse, error)
- func EqualID(e1, e2 structs.ConfigEntry) bool
- func Less(first structs.ConfigEntry, second structs.ConfigEntry) bool
- func MergeNodeServiceWithCentralConfig(ws memdb.WatchSet, state StateStore, ns *structs.NodeService, ...) (uint64, *structs.NodeService, error)
- func MergeServiceConfig(defaults *structs.ServiceConfigResponse, service *structs.NodeService) (*structs.NodeService, error)
- func SameHash(e1, e2 structs.ConfigEntry) bool
- func SortSlice(configs []structs.ConfigEntry)
- type DiscoveryChainSet
- func (e *DiscoveryChainSet) AddEntries(entries ...structs.ConfigEntry)
- func (e *DiscoveryChainSet) AddPeers(entries ...*pbpeering.Peering)
- func (e *DiscoveryChainSet) AddProxyDefaults(entries ...*structs.ProxyConfigEntry)
- func (e *DiscoveryChainSet) AddResolvers(entries ...*structs.ServiceResolverConfigEntry)
- func (e *DiscoveryChainSet) AddRouters(entries ...*structs.ServiceRouterConfigEntry)
- func (e *DiscoveryChainSet) AddSamenessGroup(entries ...*structs.SamenessGroupConfigEntry)
- func (e *DiscoveryChainSet) AddServices(entries ...*structs.ServiceConfigEntry)
- func (e *DiscoveryChainSet) AddSplitters(entries ...*structs.ServiceSplitterConfigEntry)
- func (e *DiscoveryChainSet) GetDefaultSamenessGroup() *structs.SamenessGroupConfigEntry
- func (e *DiscoveryChainSet) GetProxyDefaults(partition string) *structs.ProxyConfigEntry
- func (e *DiscoveryChainSet) GetResolver(sid structs.ServiceID) *structs.ServiceResolverConfigEntry
- func (e *DiscoveryChainSet) GetRouter(sid structs.ServiceID) *structs.ServiceRouterConfigEntry
- func (e *DiscoveryChainSet) GetSamenessGroup(name string) *structs.SamenessGroupConfigEntry
- func (e *DiscoveryChainSet) GetService(sid structs.ServiceID) *structs.ServiceConfigEntry
- func (e *DiscoveryChainSet) GetSplitter(sid structs.ServiceID) *structs.ServiceSplitterConfigEntry
- func (e *DiscoveryChainSet) IsChainEmpty() bool
- func (e *DiscoveryChainSet) IsEmpty() bool
- func (e *DiscoveryChainSet) SetDefaultSamenessGroup(entry *structs.SamenessGroupConfigEntry)
- type KindName
- type ResolvedServiceConfigSet
- func (r *ResolvedServiceConfigSet) AddProxyDefaults(entry *structs.ProxyConfigEntry)
- func (r *ResolvedServiceConfigSet) AddServiceDefaults(entry *structs.ServiceConfigEntry)
- func (r *ResolvedServiceConfigSet) GetProxyDefaults(partition string) *structs.ProxyConfigEntry
- func (r *ResolvedServiceConfigSet) GetServiceDefaults(sid structs.ServiceID) *structs.ServiceConfigEntry
- func (r *ResolvedServiceConfigSet) IsEmpty() bool
- type StateStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeResolvedServiceConfig ¶
func ComputeResolvedServiceConfig( args *structs.ServiceConfigRequest, entries *ResolvedServiceConfigSet, logger hclog.Logger, ) (*structs.ServiceConfigResponse, error)
func EqualID ¶
func EqualID(e1, e2 structs.ConfigEntry) bool
func Less ¶
func Less(first structs.ConfigEntry, second structs.ConfigEntry) bool
func MergeNodeServiceWithCentralConfig ¶
func MergeNodeServiceWithCentralConfig( ws memdb.WatchSet, state StateStore, ns *structs.NodeService, logger hclog.Logger) (uint64, *structs.NodeService, error)
MergeNodeServiceWithCentralConfig merges a service instance (NodeService) with the proxy-defaults/global and service-defaults/:service config entries. This common helper is used by the blocking query function of different RPC endpoints that need to return a fully resolved service defintion.
func MergeServiceConfig ¶
func MergeServiceConfig(defaults *structs.ServiceConfigResponse, service *structs.NodeService) (*structs.NodeService, error)
MergeServiceConfig merges the service into defaults to produce the final effective config for the specified service.
func SameHash ¶
func SameHash(e1, e2 structs.ConfigEntry) bool
func SortSlice ¶
func SortSlice(configs []structs.ConfigEntry)
Types ¶
type DiscoveryChainSet ¶
type DiscoveryChainSet struct { Routers map[structs.ServiceID]*structs.ServiceRouterConfigEntry Splitters map[structs.ServiceID]*structs.ServiceSplitterConfigEntry Resolvers map[structs.ServiceID]*structs.ServiceResolverConfigEntry Services map[structs.ServiceID]*structs.ServiceConfigEntry Peers map[string]*pbpeering.Peering DefaultSamenessGroup *structs.SamenessGroupConfigEntry SamenessGroups map[string]*structs.SamenessGroupConfigEntry ProxyDefaults map[string]*structs.ProxyConfigEntry }
DiscoveryChainSet is a wrapped set of raw cross-referenced config entries necessary for the DiscoveryChain.Get RPC process.
None of these are defaulted.
func NewDiscoveryChainSet ¶
func NewDiscoveryChainSet() *DiscoveryChainSet
func (*DiscoveryChainSet) AddEntries ¶
func (e *DiscoveryChainSet) AddEntries(entries ...structs.ConfigEntry)
AddEntries adds generic configs. Convenience function for testing. Panics on operator error.
func (*DiscoveryChainSet) AddPeers ¶
func (e *DiscoveryChainSet) AddPeers(entries ...*pbpeering.Peering)
AddPeers adds cluster peers. Convenience function for testing.
func (*DiscoveryChainSet) AddProxyDefaults ¶
func (e *DiscoveryChainSet) AddProxyDefaults(entries ...*structs.ProxyConfigEntry)
AddProxyDefaults adds proxy-defaults configs. Convenience function for testing.
func (*DiscoveryChainSet) AddResolvers ¶
func (e *DiscoveryChainSet) AddResolvers(entries ...*structs.ServiceResolverConfigEntry)
AddResolvers adds resolver configs. Convenience function for testing.
func (*DiscoveryChainSet) AddRouters ¶
func (e *DiscoveryChainSet) AddRouters(entries ...*structs.ServiceRouterConfigEntry)
AddRouters adds router configs. Convenience function for testing.
func (*DiscoveryChainSet) AddSamenessGroup ¶
func (e *DiscoveryChainSet) AddSamenessGroup(entries ...*structs.SamenessGroupConfigEntry)
AddSamenessGroup adds a sameness group. Convenience function for testing.
func (*DiscoveryChainSet) AddServices ¶
func (e *DiscoveryChainSet) AddServices(entries ...*structs.ServiceConfigEntry)
AddServices adds service configs. Convenience function for testing.
func (*DiscoveryChainSet) AddSplitters ¶
func (e *DiscoveryChainSet) AddSplitters(entries ...*structs.ServiceSplitterConfigEntry)
AddSplitters adds splitter configs. Convenience function for testing.
func (*DiscoveryChainSet) GetDefaultSamenessGroup ¶
func (e *DiscoveryChainSet) GetDefaultSamenessGroup() *structs.SamenessGroupConfigEntry
func (*DiscoveryChainSet) GetProxyDefaults ¶
func (e *DiscoveryChainSet) GetProxyDefaults(partition string) *structs.ProxyConfigEntry
func (*DiscoveryChainSet) GetResolver ¶
func (e *DiscoveryChainSet) GetResolver(sid structs.ServiceID) *structs.ServiceResolverConfigEntry
func (*DiscoveryChainSet) GetRouter ¶
func (e *DiscoveryChainSet) GetRouter(sid structs.ServiceID) *structs.ServiceRouterConfigEntry
func (*DiscoveryChainSet) GetSamenessGroup ¶
func (e *DiscoveryChainSet) GetSamenessGroup(name string) *structs.SamenessGroupConfigEntry
func (*DiscoveryChainSet) GetService ¶
func (e *DiscoveryChainSet) GetService(sid structs.ServiceID) *structs.ServiceConfigEntry
func (*DiscoveryChainSet) GetSplitter ¶
func (e *DiscoveryChainSet) GetSplitter(sid structs.ServiceID) *structs.ServiceSplitterConfigEntry
func (*DiscoveryChainSet) IsChainEmpty ¶
func (e *DiscoveryChainSet) IsChainEmpty() bool
IsChainEmpty returns true if there are no service-routers, service-splitters, or service-resolvers that are present. These config entries are the primary parts of the discovery chain.
func (*DiscoveryChainSet) IsEmpty ¶
func (e *DiscoveryChainSet) IsEmpty() bool
IsEmpty returns true if there are no config entries at all in the response. You should prefer this over IsChainEmpty() in most cases.
func (*DiscoveryChainSet) SetDefaultSamenessGroup ¶
func (e *DiscoveryChainSet) SetDefaultSamenessGroup(entry *structs.SamenessGroupConfigEntry)
SetDefaultSamenessGroup sets the default sameness group. Convenience function for testing.
type KindName ¶
type KindName struct { Kind string Name string acl.EnterpriseMeta }
KindName is a value type useful for maps. You can use:
map[KindName]Payload
instead of:
map[string]map[string]Payload
func NewKindName ¶
func NewKindName(kind, name string, entMeta *acl.EnterpriseMeta) KindName
NewKindName returns a new KindName. The EnterpriseMeta values will be normalized based on the kind.
Any caller which modifies the EnterpriseMeta field must call Normalize before persisting or using the value as a map key.
func NewKindNameForEntry ¶
func NewKindNameForEntry(entry structs.ConfigEntry) KindName
type ResolvedServiceConfigSet ¶
type ResolvedServiceConfigSet struct { ServiceDefaults map[structs.ServiceID]*structs.ServiceConfigEntry ProxyDefaults map[string]*structs.ProxyConfigEntry }
ResolvedServiceConfigSet is a wrapped set of raw cross-referenced config entries necessary for the ConfigEntry.ResolveServiceConfig RPC process.
None of these are defaulted.
func (*ResolvedServiceConfigSet) AddProxyDefaults ¶
func (r *ResolvedServiceConfigSet) AddProxyDefaults(entry *structs.ProxyConfigEntry)
func (*ResolvedServiceConfigSet) AddServiceDefaults ¶
func (r *ResolvedServiceConfigSet) AddServiceDefaults(entry *structs.ServiceConfigEntry)
func (*ResolvedServiceConfigSet) GetProxyDefaults ¶
func (r *ResolvedServiceConfigSet) GetProxyDefaults(partition string) *structs.ProxyConfigEntry
func (*ResolvedServiceConfigSet) GetServiceDefaults ¶
func (r *ResolvedServiceConfigSet) GetServiceDefaults(sid structs.ServiceID) *structs.ServiceConfigEntry
func (*ResolvedServiceConfigSet) IsEmpty ¶
func (r *ResolvedServiceConfigSet) IsEmpty() bool