Documentation ¶
Index ¶
- Variables
- type Cache
- func (c *Cache) Delete(ctx context.Context, ref api.ResourceReference) error
- func (c *Cache) Deregister(ctx context.Context, deregistration api.CatalogDeregistration) error
- func (c *Cache) EnsureRoleBinding(authMethod, service, namespace string) error
- func (c *Cache) Get(ref api.ResourceReference) api.ConfigEntry
- func (c *Cache) List(kind string) []api.ConfigEntry
- func (c *Cache) Register(ctx context.Context, registration api.CatalogRegistration) error
- func (c *Cache) RemoveRoleBinding(authMethod, service, namespace string) error
- func (c *Cache) Run(ctx context.Context)
- func (c *Cache) Subscribe(ctx context.Context, kind string, translator TranslatorFn) *Subscription
- func (c *Cache) WaitSynced(ctx context.Context)
- func (c *Cache) Write(ctx context.Context, entry api.ConfigEntry) error
- type Config
- type GatewayCache
- func (r *GatewayCache) EnsureSubscribed(ref api.ResourceReference, resource types.NamespacedName)
- func (r *GatewayCache) FetchServicesFor(ctx context.Context, ref api.ResourceReference) ([]api.CatalogService, error)
- func (r *GatewayCache) RemoveSubscription(ref api.ResourceReference)
- func (r *GatewayCache) ServicesFor(ref api.ResourceReference) []api.CatalogService
- type Subscription
- type TranslatorFn
Constants ¶
This section is empty.
Variables ¶
var ( ErrFailedToDeleteBindingRule = errors.New("failed to delete ACLBindingRule") ErrFailedToDeleteRole = errors.New("failed to delete ACLRole") ErrFailedToDeletePolicy = errors.New("failed to delete ACLPolicy") ErrACLSDisabled = errors.New("ACLs are disabled") )
var Kinds = []string{api.APIGateway, api.HTTPRoute, api.TCPRoute, api.FileSystemCertificate, api.JWTProvider}
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache subscribes to and caches Consul objects, it also responsible for mainting subscriptions to resources that it caches.
func (*Cache) Delete ¶
Delete handles deleting the config entry from consul, if the current reference of the config entry is stale then it returns an error.
func (*Cache) Deregister ¶
Deregister deregisters a service in Consul.
func (*Cache) EnsureRoleBinding ¶
func (*Cache) Get ¶
func (c *Cache) Get(ref api.ResourceReference) api.ConfigEntry
Get returns a config entry from the cache that corresponds to the given resource reference.
func (*Cache) List ¶
func (c *Cache) List(kind string) []api.ConfigEntry
List returns a list of config entries from the cache that corresponds to the given kind.
func (*Cache) RemoveRoleBinding ¶
func (*Cache) Run ¶
Run starts the cache watch cycle, on the first call it will fill the cache with existing resources.
func (*Cache) Subscribe ¶
func (c *Cache) Subscribe(ctx context.Context, kind string, translator TranslatorFn) *Subscription
Subscribe handles adding a new subscription for resources of a given kind.
func (*Cache) WaitSynced ¶
WaitSynced is used to coordinate with the caller when the cache is initially filled.
type GatewayCache ¶
type GatewayCache struct {
// contains filtered or unexported fields
}
func NewGatewayCache ¶
func NewGatewayCache(ctx context.Context, config Config) *GatewayCache
func (*GatewayCache) EnsureSubscribed ¶
func (r *GatewayCache) EnsureSubscribed(ref api.ResourceReference, resource types.NamespacedName)
func (*GatewayCache) FetchServicesFor ¶
func (r *GatewayCache) FetchServicesFor(ctx context.Context, ref api.ResourceReference) ([]api.CatalogService, error)
func (*GatewayCache) RemoveSubscription ¶
func (r *GatewayCache) RemoveSubscription(ref api.ResourceReference)
func (*GatewayCache) ServicesFor ¶
func (r *GatewayCache) ServicesFor(ref api.ResourceReference) []api.CatalogService
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
Subscription represents a watcher for events on a specific kind.
func (*Subscription) Cancel ¶
func (s *Subscription) Cancel()
func (*Subscription) Events ¶
func (s *Subscription) Events() chan event.GenericEvent
type TranslatorFn ¶
type TranslatorFn func(api.ConfigEntry) []types.NamespacedName