Documentation
¶
Index ¶
- Variables
- type ACLGroup
- type ACLGroupsCollection
- func (k *ACLGroupsCollection) Add(aclGroup ACLGroup) error
- func (k *ACLGroupsCollection) Delete(id string) error
- func (k *ACLGroupsCollection) Get(consumerID, groupOrID string) (*ACLGroup, error)
- func (k *ACLGroupsCollection) GetAll() ([]*ACLGroup, error)
- func (k *ACLGroupsCollection) GetAllByConsumerID(id string) ([]*ACLGroup, error)
- func (k *ACLGroupsCollection) GetByID(id string) (*ACLGroup, error)
- func (k *ACLGroupsCollection) Update(aclGroup ACLGroup) error
- type BasicAuth
- func (b1 *BasicAuth) Console() string
- func (b1 *BasicAuth) Equal(b2 *BasicAuth) bool
- func (b1 *BasicAuth) EqualWithOpts(b2 *BasicAuth, ignoreID, ignoreTS, ignorePassword, ignoreForeign bool) bool
- func (b1 *BasicAuth) GetConsumer() string
- func (b1 *BasicAuth) GetID() string
- func (b1 *BasicAuth) GetID2() string
- type BasicAuthsCollection
- func (k *BasicAuthsCollection) Add(basicAuth BasicAuth) error
- func (k *BasicAuthsCollection) Delete(keyOrID string) error
- func (k *BasicAuthsCollection) Get(keyOrID string) (*BasicAuth, error)
- func (k *BasicAuthsCollection) GetAll() ([]*BasicAuth, error)
- func (k *BasicAuthsCollection) GetAllByConsumerID(id string) ([]*BasicAuth, error)
- func (k *BasicAuthsCollection) Schema() *memdb.TableSchema
- func (k *BasicAuthsCollection) TableName() string
- func (k *BasicAuthsCollection) Update(basicAuth BasicAuth) error
- type CACertificate
- type CACertificatesCollection
- func (k *CACertificatesCollection) Add(caCert CACertificate) error
- func (k *CACertificatesCollection) Delete(certOrID string) error
- func (k *CACertificatesCollection) Get(certOrID string) (*CACertificate, error)
- func (k *CACertificatesCollection) GetAll() ([]*CACertificate, error)
- func (k *CACertificatesCollection) Update(caCert CACertificate) error
- type Certificate
- type CertificatesCollection
- func (k *CertificatesCollection) Add(certificate Certificate) error
- func (k *CertificatesCollection) Delete(id string) error
- func (k *CertificatesCollection) DeleteByCertKey(cert, key string) error
- func (k *CertificatesCollection) Get(id string) (*Certificate, error)
- func (k *CertificatesCollection) GetAll() ([]*Certificate, error)
- func (k *CertificatesCollection) GetByCertKey(cert, key string) (*Certificate, error)
- func (k *CertificatesCollection) Update(certificate Certificate) error
- type ConsoleString
- type Consumer
- type ConsumersCollection
- func (k *ConsumersCollection) Add(consumer Consumer) error
- func (k *ConsumersCollection) Delete(userNameOrID string) error
- func (k *ConsumersCollection) Get(userNameOrID string) (*Consumer, error)
- func (k *ConsumersCollection) GetAll() ([]*Consumer, error)
- func (k *ConsumersCollection) Update(consumer Consumer) error
- type HMACAuth
- type HMACAuthsCollection
- func (k *HMACAuthsCollection) Add(hmacAuth HMACAuth) error
- func (k *HMACAuthsCollection) Delete(keyOrID string) error
- func (k *HMACAuthsCollection) Get(keyOrID string) (*HMACAuth, error)
- func (k *HMACAuthsCollection) GetAll() ([]*HMACAuth, error)
- func (k *HMACAuthsCollection) GetAllByConsumerID(id string) ([]*HMACAuth, error)
- func (k *HMACAuthsCollection) Schema() *memdb.TableSchema
- func (k *HMACAuthsCollection) TableName() string
- func (k *HMACAuthsCollection) Update(hmacAuth HMACAuth) error
- type JWTAuth
- type JWTAuthsCollection
- func (k *JWTAuthsCollection) Add(jwtAuth JWTAuth) error
- func (k *JWTAuthsCollection) Delete(keyOrID string) error
- func (k *JWTAuthsCollection) Get(keyOrID string) (*JWTAuth, error)
- func (k *JWTAuthsCollection) GetAll() ([]*JWTAuth, error)
- func (k *JWTAuthsCollection) GetAllByConsumerID(id string) ([]*JWTAuth, error)
- func (k *JWTAuthsCollection) Schema() *memdb.TableSchema
- func (k *JWTAuthsCollection) TableName() string
- func (k *JWTAuthsCollection) Update(jwtAuth JWTAuth) error
- type KeyAuth
- type KeyAuthsCollection
- func (k *KeyAuthsCollection) Add(keyAuth KeyAuth) error
- func (k *KeyAuthsCollection) Delete(keyOrID string) error
- func (k *KeyAuthsCollection) Get(keyOrID string) (*KeyAuth, error)
- func (k *KeyAuthsCollection) GetAll() ([]*KeyAuth, error)
- func (k *KeyAuthsCollection) GetAllByConsumerID(id string) ([]*KeyAuth, error)
- func (k *KeyAuthsCollection) Schema() *memdb.TableSchema
- func (k *KeyAuthsCollection) TableName() string
- func (k *KeyAuthsCollection) Update(keyAuth KeyAuth) error
- type KongState
- type MTLSAuth
- type MTLSAuthsCollection
- func (k *MTLSAuthsCollection) Add(mtlsAuth MTLSAuth) error
- func (k *MTLSAuthsCollection) Delete(ID string) error
- func (k *MTLSAuthsCollection) Get(ID string) (*MTLSAuth, error)
- func (k *MTLSAuthsCollection) GetAll() ([]*MTLSAuth, error)
- func (k *MTLSAuthsCollection) GetAllByConsumerID(id string) ([]*MTLSAuth, error)
- func (k *MTLSAuthsCollection) Schema() *memdb.TableSchema
- func (k *MTLSAuthsCollection) TableName() string
- func (k *MTLSAuthsCollection) Update(mtlsAuth MTLSAuth) error
- type Meta
- type Oauth2Credential
- func (k1 *Oauth2Credential) Console() string
- func (k1 *Oauth2Credential) Equal(k2 *Oauth2Credential) bool
- func (k1 *Oauth2Credential) EqualWithOpts(k2 *Oauth2Credential, ignoreID, ignoreTS, ignoreForeign bool) bool
- func (k1 *Oauth2Credential) GetConsumer() string
- func (k1 *Oauth2Credential) GetID() string
- func (k1 *Oauth2Credential) GetID2() string
- type Oauth2CredsCollection
- func (k *Oauth2CredsCollection) Add(keyAuth Oauth2Credential) error
- func (k *Oauth2CredsCollection) Delete(keyOrID string) error
- func (k *Oauth2CredsCollection) Get(keyOrID string) (*Oauth2Credential, error)
- func (k *Oauth2CredsCollection) GetAll() ([]*Oauth2Credential, error)
- func (k *Oauth2CredsCollection) GetAllByConsumerID(id string) ([]*Oauth2Credential, error)
- func (k *Oauth2CredsCollection) Schema() *memdb.TableSchema
- func (k *Oauth2CredsCollection) TableName() string
- func (k *Oauth2CredsCollection) Update(keyAuth Oauth2Credential) error
- type Plugin
- type PluginsCollection
- func (k *PluginsCollection) Add(plugin Plugin) error
- func (k *PluginsCollection) Delete(id string) error
- func (k *PluginsCollection) Get(id string) (*Plugin, error)
- func (k *PluginsCollection) GetAll() ([]*Plugin, error)
- func (k *PluginsCollection) GetAllByConsumerID(id string) ([]*Plugin, error)
- func (k *PluginsCollection) GetAllByName(name string) ([]*Plugin, error)
- func (k *PluginsCollection) GetAllByRouteID(id string) ([]*Plugin, error)
- func (k *PluginsCollection) GetAllByServiceID(id string) ([]*Plugin, error)
- func (k *PluginsCollection) GetByProp(name, serviceID, routeID string, consumerID string) (*Plugin, error)
- func (k *PluginsCollection) Update(plugin Plugin) error
- type Route
- type RoutesCollection
- func (k *RoutesCollection) Add(route Route) error
- func (k *RoutesCollection) Delete(nameOrID string) error
- func (k *RoutesCollection) Get(nameOrID string) (*Route, error)
- func (k *RoutesCollection) GetAll() ([]*Route, error)
- func (k *RoutesCollection) GetAllByServiceID(id string) ([]*Route, error)
- func (k *RoutesCollection) Update(route Route) error
- type SNI
- type SNIsCollection
- func (k *SNIsCollection) Add(sni SNI) error
- func (k *SNIsCollection) Delete(nameOrID string) error
- func (k *SNIsCollection) Get(nameOrID string) (*SNI, error)
- func (k *SNIsCollection) GetAll() ([]*SNI, error)
- func (k *SNIsCollection) GetAllByCertID(id string) ([]*SNI, error)
- func (k *SNIsCollection) Update(sni SNI) error
- type Service
- type ServicesCollection
- type Target
- type TargetsCollection
- func (k *TargetsCollection) Add(target Target) error
- func (k *TargetsCollection) Delete(upstreamID, targetOrID string) error
- func (k *TargetsCollection) Get(upstreamID, targetOrID string) (*Target, error)
- func (k *TargetsCollection) GetAll() ([]*Target, error)
- func (k *TargetsCollection) GetAllByUpstreamID(id string) ([]*Target, error)
- func (k *TargetsCollection) Update(target Target) error
- type Upstream
- type UpstreamsCollection
- func (k *UpstreamsCollection) Add(upstream Upstream) error
- func (k *UpstreamsCollection) Delete(nameOrID string) error
- func (k *UpstreamsCollection) Get(nameOrID string) (*Upstream, error)
- func (k *UpstreamsCollection) GetAll() ([]*Upstream, error)
- func (k *UpstreamsCollection) Update(upstream Upstream) error
Constants ¶
This section is empty.
Variables ¶
var ErrAlreadyExists = errors.New("entity already exists")
ErrAlreadyExists represents an entity is already present in the state.
var ErrNotFound = errors.New("entity not found")
ErrNotFound is an error type that is returned when an entity is not found in the state.
Functions ¶
This section is empty.
Types ¶
type ACLGroup ¶ added in v0.5.0
ACLGroup represents an ACL group for a consumer in Kong. It adds some helper methods along with Meta to the original ACLGroup object.
func (*ACLGroup) Console ¶ added in v0.7.0
Console returns an entity's identity in a human readable string.
func (*ACLGroup) EqualWithOpts ¶ added in v0.5.0
EqualWithOpts returns true if j1 and j2 are equal. If ignoreID is set to true, IDs will be ignored while comparison. If ignoreTS is set to true, timestamp fields will be ignored.
type ACLGroupsCollection ¶ added in v0.5.0
type ACLGroupsCollection collection
ACLGroupsCollection stores and indexes acl-group credentials.
func (*ACLGroupsCollection) Add ¶ added in v0.5.0
func (k *ACLGroupsCollection) Add(aclGroup ACLGroup) error
Add adds aclGroup to ACLGroupsCollection
func (*ACLGroupsCollection) Delete ¶ added in v0.6.0
func (k *ACLGroupsCollection) Delete(id string) error
Delete deletes an acl-group by id.
func (*ACLGroupsCollection) Get ¶ added in v0.5.0
func (k *ACLGroupsCollection) Get(consumerID, groupOrID string) (*ACLGroup, error)
Get gets a acl-group for a consumer by group or ID.
func (*ACLGroupsCollection) GetAll ¶ added in v0.5.0
func (k *ACLGroupsCollection) GetAll() ([]*ACLGroup, error)
GetAll gets all acl-groups.
func (*ACLGroupsCollection) GetAllByConsumerID ¶ added in v0.5.0
func (k *ACLGroupsCollection) GetAllByConsumerID(id string) ([]*ACLGroup, error)
GetAllByConsumerID returns all acl-group credentials belong to a Consumer with id.
func (*ACLGroupsCollection) GetByID ¶ added in v0.5.0
func (k *ACLGroupsCollection) GetByID(id string) (*ACLGroup, error)
GetByID gets an acl-group with id.
func (*ACLGroupsCollection) Update ¶ added in v0.5.0
func (k *ACLGroupsCollection) Update(aclGroup ACLGroup) error
Update updates an existing acl-group credential.
type BasicAuth ¶ added in v0.5.0
BasicAuth represents a basic-auth credential in Kong. It adds some helper methods along with Meta to the original BasicAuth object.
func (*BasicAuth) Console ¶ added in v0.7.0
Console returns an entity's identity in a human readable string.
func (*BasicAuth) EqualWithOpts ¶ added in v0.5.0
func (b1 *BasicAuth) EqualWithOpts(b2 *BasicAuth, ignoreID, ignoreTS, ignorePassword, ignoreForeign bool) bool
EqualWithOpts returns true if j1 and j2 are equal. If ignoreID is set to true, IDs will be ignored while comparison. If ignoreTS is set to true, timestamp fields will be ignored.
func (*BasicAuth) GetConsumer ¶ added in v0.6.0
GetConsumer returns the credential's Consumer's ID. If Consumer's ID is empty, it returns an empty string.
type BasicAuthsCollection ¶ added in v0.5.0
type BasicAuthsCollection struct {
// contains filtered or unexported fields
}
BasicAuthsCollection stores and indexes basic-auth credentials.
func (*BasicAuthsCollection) Add ¶ added in v0.5.0
func (k *BasicAuthsCollection) Add(basicAuth BasicAuth) error
Add adds a basic-auth credential to BasicAuthsCollection
func (*BasicAuthsCollection) Delete ¶ added in v0.5.0
func (k *BasicAuthsCollection) Delete(keyOrID string) error
Delete deletes a basic-auth credential by key or ID.
func (*BasicAuthsCollection) Get ¶ added in v0.5.0
func (k *BasicAuthsCollection) Get(keyOrID string) (*BasicAuth, error)
Get gets a basic-auth credential by key or ID.
func (*BasicAuthsCollection) GetAll ¶ added in v0.5.0
func (k *BasicAuthsCollection) GetAll() ([]*BasicAuth, error)
GetAll gets all basic-auth credentials.
func (*BasicAuthsCollection) GetAllByConsumerID ¶ added in v0.5.0
func (k *BasicAuthsCollection) GetAllByConsumerID(id string) ([]*BasicAuth, error)
GetAllByConsumerID returns all basic-auth credentials belong to a Consumer with id.
func (*BasicAuthsCollection) Schema ¶ added in v0.6.0
func (k *BasicAuthsCollection) Schema() *memdb.TableSchema
func (*BasicAuthsCollection) TableName ¶ added in v0.6.0
func (k *BasicAuthsCollection) TableName() string
func (*BasicAuthsCollection) Update ¶ added in v0.5.0
func (k *BasicAuthsCollection) Update(basicAuth BasicAuth) error
Update updates an existing basic-auth credential.
type CACertificate ¶ added in v0.5.0
type CACertificate struct { kong.CACertificate `yaml:",inline"` Meta }
CACertificate represents a CACertificate in Kong. It adds some helper methods along with Meta to the original CACertificate object.
func (*CACertificate) Console ¶ added in v0.7.0
func (c1 *CACertificate) Console() string
Console returns an entity's identity in a human readable string.
func (*CACertificate) Equal ¶ added in v0.5.0
func (c1 *CACertificate) Equal(c2 *CACertificate) bool
Equal returns true if c1 and c2 are equal.
func (*CACertificate) EqualWithOpts ¶ added in v0.5.0
func (c1 *CACertificate) EqualWithOpts(c2 *CACertificate, ignoreID bool, ignoreTS bool) bool
EqualWithOpts returns true if c1 and c2 are equal. If ignoreID is set to true, IDs will be ignored while comparison. If ignoreTS is set to true, timestamp fields will be ignored.
func (*CACertificate) Identifier ¶ added in v0.6.0
func (c1 *CACertificate) Identifier() string
Identifier returns the endpoint key name or ID.
type CACertificatesCollection ¶ added in v0.5.0
type CACertificatesCollection collection
CACertificatesCollection stores and indexes Kong CACertificates.
func (*CACertificatesCollection) Add ¶ added in v0.5.0
func (k *CACertificatesCollection) Add(caCert CACertificate) error
Add adds a caCert to the collection
func (*CACertificatesCollection) Delete ¶ added in v0.5.0
func (k *CACertificatesCollection) Delete(certOrID string) error
Delete deletes a caCertificate by looking up it's cert and key.
func (*CACertificatesCollection) Get ¶ added in v0.5.0
func (k *CACertificatesCollection) Get(certOrID string) (*CACertificate, error)
Get gets a caCertificate by cert or ID.
func (*CACertificatesCollection) GetAll ¶ added in v0.5.0
func (k *CACertificatesCollection) GetAll() ([]*CACertificate, error)
GetAll gets a caCertificate by name or ID.
func (*CACertificatesCollection) Update ¶ added in v0.5.0
func (k *CACertificatesCollection) Update(caCert CACertificate) error
Update udpates an existing caCert. It returns an error if the caCert is not already present.
type Certificate ¶
type Certificate struct { kong.Certificate `yaml:",inline"` Meta }
Certificate represents a upstream in Kong. It adds some helper methods along with Meta to the original Certificate object.
func (*Certificate) Console ¶ added in v0.7.0
func (c1 *Certificate) Console() string
Console returns an entity's identity in a human readable string.
func (*Certificate) Equal ¶
func (c1 *Certificate) Equal(c2 *Certificate) bool
Equal returns true if c1 and c2 are equal.
func (*Certificate) EqualWithOpts ¶
func (c1 *Certificate) EqualWithOpts(c2 *Certificate, ignoreID bool, ignoreTS bool) bool
EqualWithOpts returns true if c1 and c2 are equal. If ignoreID is set to true, IDs will be ignored while comparison. If ignoreTS is set to true, timestamp fields will be ignored.
func (*Certificate) Identifier ¶ added in v0.6.0
func (c1 *Certificate) Identifier() string
Identifier returns the endpoint key name or ID.
type CertificatesCollection ¶
type CertificatesCollection collection
CertificatesCollection stores and indexes Kong Certificates.
func (*CertificatesCollection) Add ¶
func (k *CertificatesCollection) Add(certificate Certificate) error
Add adds a certificate to the collection
func (*CertificatesCollection) Delete ¶
func (k *CertificatesCollection) Delete(id string) error
Delete deletes a certificate by ID.
func (*CertificatesCollection) DeleteByCertKey ¶
func (k *CertificatesCollection) DeleteByCertKey(cert, key string) error
DeleteByCertKey deletes a certificate by looking up it's cert and key.
func (*CertificatesCollection) Get ¶
func (k *CertificatesCollection) Get(id string) (*Certificate, error)
Get gets a certificate by ID.
func (*CertificatesCollection) GetAll ¶
func (k *CertificatesCollection) GetAll() ([]*Certificate, error)
GetAll gets a certificate by name or ID.
func (*CertificatesCollection) GetByCertKey ¶
func (k *CertificatesCollection) GetByCertKey(cert, key string) (*Certificate, error)
GetByCertKey gets a certificate with the same key and cert from the collection.
func (*CertificatesCollection) Update ¶
func (k *CertificatesCollection) Update(certificate Certificate) error
Update udpates an existing certificate. It returns an error if the certificate is not already present.
type ConsoleString ¶ added in v0.7.0
type ConsoleString interface { // Console returns a string to uniquely identify an // entity in human-readable form. // It should have the ID or endpoint key along-with // foreign references if they exist. // It will be used to communicate to the human user // that this entity is undergoing some change. Console() string }
ConsoleString contains methods to be used to print entity to console.
type Consumer ¶ added in v0.2.0
Consumer represents a consumer in Kong. It adds some helper methods along with Meta to the original Consumer object.
func (*Consumer) Console ¶ added in v0.7.0
Console returns an entity's identity in a human readable string.
func (*Consumer) EqualWithOpts ¶ added in v0.2.0
EqualWithOpts returns true if c1 and c2 are equal. If ignoreID is set to true, IDs will be ignored while comparison. If ignoreTS is set to true, timestamp fields will be ignored.
func (*Consumer) Identifier ¶ added in v0.6.0
Identifier returns the endpoint key name or ID.
type ConsumersCollection ¶ added in v0.2.0
type ConsumersCollection collection
ConsumersCollection stores and indexes Kong Consumers.
func (*ConsumersCollection) Add ¶ added in v0.2.0
func (k *ConsumersCollection) Add(consumer Consumer) error
Add adds a consumer to the collection An error is thrown if consumer.ID is empty.
func (*ConsumersCollection) Delete ¶ added in v0.2.0
func (k *ConsumersCollection) Delete(userNameOrID string) error
Delete deletes a consumer by name or ID.
func (*ConsumersCollection) Get ¶ added in v0.2.0
func (k *ConsumersCollection) Get(userNameOrID string) (*Consumer, error)
Get gets a consumer by name or ID.
func (*ConsumersCollection) GetAll ¶ added in v0.2.0
func (k *ConsumersCollection) GetAll() ([]*Consumer, error)
GetAll gets a consumer by name or ID.
func (*ConsumersCollection) Update ¶ added in v0.2.0
func (k *ConsumersCollection) Update(consumer Consumer) error
Update udpates an existing consumer. It returns an error if the consumer is not already present.
type HMACAuth ¶ added in v0.5.0
HMACAuth represents a key-auth credential in Kong. It adds some helper methods along with Meta to the original HMACAuth object.
func (*HMACAuth) Console ¶ added in v0.7.0
Console returns an entity's identity in a human readable string.
func (*HMACAuth) EqualWithOpts ¶ added in v0.5.0
EqualWithOpts returns true if h1 and h2 are equal. If ignoreID is set to true, IDs will be ignored while comparison. If ignoreTS is set to true, timestamp fields will be ignored.
func (*HMACAuth) GetConsumer ¶ added in v0.6.0
GetConsumer returns the credential's Consumer's ID. If Consumer's ID is empty, it returns an empty string.
type HMACAuthsCollection ¶ added in v0.5.0
type HMACAuthsCollection struct {
// contains filtered or unexported fields
}
HMACAuthsCollection stores and indexes hmac-auth credentials.
func (*HMACAuthsCollection) Add ¶ added in v0.5.0
func (k *HMACAuthsCollection) Add(hmacAuth HMACAuth) error
Add adds a hmac-auth credential to HMACAuthsCollection
func (*HMACAuthsCollection) Delete ¶ added in v0.5.0
func (k *HMACAuthsCollection) Delete(keyOrID string) error
Delete deletes a hmac-auth credential by key or ID.
func (*HMACAuthsCollection) Get ¶ added in v0.5.0
func (k *HMACAuthsCollection) Get(keyOrID string) (*HMACAuth, error)
Get gets a hmac-auth credential by key or ID.
func (*HMACAuthsCollection) GetAll ¶ added in v0.5.0
func (k *HMACAuthsCollection) GetAll() ([]*HMACAuth, error)
GetAll gets all hmac-auth credentials.
func (*HMACAuthsCollection) GetAllByConsumerID ¶ added in v0.5.0
func (k *HMACAuthsCollection) GetAllByConsumerID(id string) ([]*HMACAuth, error)
GetAllByConsumerID returns all hmac-auth credentials belong to a Consumer with id.
func (*HMACAuthsCollection) Schema ¶ added in v0.6.0
func (k *HMACAuthsCollection) Schema() *memdb.TableSchema
func (*HMACAuthsCollection) TableName ¶ added in v0.6.0
func (k *HMACAuthsCollection) TableName() string
func (*HMACAuthsCollection) Update ¶ added in v0.5.0
func (k *HMACAuthsCollection) Update(hmacAuth HMACAuth) error
Update updates an existing hmac-auth credential.
type JWTAuth ¶ added in v0.5.0
JWTAuth represents a jwt credential in Kong. It adds some helper methods along with Meta to the original JWTAuth object.
func (*JWTAuth) Console ¶ added in v0.7.0
Console returns an entity's identity in a human readable string.
func (*JWTAuth) EqualWithOpts ¶ added in v0.5.0
EqualWithOpts returns true if j1 and j2 are equal. If ignoreID is set to true, IDs will be ignored while comparison. If ignoreTS is set to true, timestamp fields will be ignored.
func (*JWTAuth) GetConsumer ¶ added in v0.6.0
GetConsumer returns the credential's Consumer's ID. If Consumer's ID is empty, it returns an empty string.
type JWTAuthsCollection ¶ added in v0.5.0
type JWTAuthsCollection struct {
// contains filtered or unexported fields
}
JWTAuthsCollection stores and indexes jwt-auth credentials.
func (*JWTAuthsCollection) Add ¶ added in v0.5.0
func (k *JWTAuthsCollection) Add(jwtAuth JWTAuth) error
Add adds a jwt-auth credential to JWTAuthsCollection
func (*JWTAuthsCollection) Delete ¶ added in v0.5.0
func (k *JWTAuthsCollection) Delete(keyOrID string) error
Delete deletes a jwt-auth credential by key or ID.
func (*JWTAuthsCollection) Get ¶ added in v0.5.0
func (k *JWTAuthsCollection) Get(keyOrID string) (*JWTAuth, error)
Get gets a jwt-auth credential by key or ID.
func (*JWTAuthsCollection) GetAll ¶ added in v0.5.0
func (k *JWTAuthsCollection) GetAll() ([]*JWTAuth, error)
GetAll gets all jwt-auth credentials.
func (*JWTAuthsCollection) GetAllByConsumerID ¶ added in v0.5.0
func (k *JWTAuthsCollection) GetAllByConsumerID(id string) ([]*JWTAuth, error)
GetAllByConsumerID returns all jwt-auth credentials belong to a Consumer with id.
func (*JWTAuthsCollection) Schema ¶ added in v0.6.0
func (k *JWTAuthsCollection) Schema() *memdb.TableSchema
func (*JWTAuthsCollection) TableName ¶ added in v0.6.0
func (k *JWTAuthsCollection) TableName() string
func (*JWTAuthsCollection) Update ¶ added in v0.5.0
func (k *JWTAuthsCollection) Update(jwtAuth JWTAuth) error
Update updates an existing jwt-auth credential.
type KeyAuth ¶ added in v0.5.0
KeyAuth represents a key-auth credential in Kong. It adds some helper methods along with Meta to the original KeyAuth object.
func (*KeyAuth) Console ¶ added in v0.7.0
Console returns an entity's identity in a human readable string.
func (*KeyAuth) EqualWithOpts ¶ added in v0.5.0
EqualWithOpts returns true if k1 and k2 are equal. If ignoreID is set to true, IDs will be ignored while comparison. If ignoreTS is set to true, timestamp fields will be ignored.
func (*KeyAuth) GetConsumer ¶ added in v0.6.0
GetConsumer returns the credential's Consumer's ID. If Consumer's ID is empty, it returns an empty string.
type KeyAuthsCollection ¶ added in v0.5.0
type KeyAuthsCollection struct {
// contains filtered or unexported fields
}
KeyAuthsCollection stores and indexes key-auth credentials.
func (*KeyAuthsCollection) Add ¶ added in v0.5.0
func (k *KeyAuthsCollection) Add(keyAuth KeyAuth) error
Add adds a key-auth credential to KeyAuthsCollection
func (*KeyAuthsCollection) Delete ¶ added in v0.5.0
func (k *KeyAuthsCollection) Delete(keyOrID string) error
Delete deletes a key-auth credential by key or ID.
func (*KeyAuthsCollection) Get ¶ added in v0.5.0
func (k *KeyAuthsCollection) Get(keyOrID string) (*KeyAuth, error)
Get gets a key-auth credential by key or ID.
func (*KeyAuthsCollection) GetAll ¶ added in v0.5.0
func (k *KeyAuthsCollection) GetAll() ([]*KeyAuth, error)
GetAll gets all key-auth credentials.
func (*KeyAuthsCollection) GetAllByConsumerID ¶ added in v0.5.0
func (k *KeyAuthsCollection) GetAllByConsumerID(id string) ([]*KeyAuth, error)
GetAllByConsumerID returns all key-auth credentials belong to a Consumer with id.
func (*KeyAuthsCollection) Schema ¶ added in v0.6.0
func (k *KeyAuthsCollection) Schema() *memdb.TableSchema
func (*KeyAuthsCollection) TableName ¶ added in v0.6.0
func (k *KeyAuthsCollection) TableName() string
func (*KeyAuthsCollection) Update ¶ added in v0.5.0
func (k *KeyAuthsCollection) Update(keyAuth KeyAuth) error
Update updates an existing key-auth credential.
type KongState ¶
type KongState struct { Services *ServicesCollection Routes *RoutesCollection Upstreams *UpstreamsCollection Targets *TargetsCollection Certificates *CertificatesCollection SNIs *SNIsCollection CACertificates *CACertificatesCollection Plugins *PluginsCollection Consumers *ConsumersCollection KeyAuths *KeyAuthsCollection HMACAuths *HMACAuthsCollection JWTAuths *JWTAuthsCollection BasicAuths *BasicAuthsCollection ACLGroups *ACLGroupsCollection Oauth2Creds *Oauth2CredsCollection MTLSAuths *MTLSAuthsCollection // contains filtered or unexported fields }
KongState is an in-memory database representation of Kong's configuration.
func Get ¶ added in v0.6.0
func Get(raw *utils.KongRawState) (*KongState, error)
Get builds a KongState from a raw representation of Kong.
func NewKongState ¶
NewKongState creates a new in-memory KongState.
type MTLSAuth ¶ added in v1.2.0
MTLSAuth represents an mtls-auth credential in Kong. It adds some helper methods along with Meta to the original MTLSAuth object.
func (*MTLSAuth) Console ¶ added in v1.2.0
Console returns an entity's identity in a human readable string.
func (*MTLSAuth) EqualWithOpts ¶ added in v1.2.0
EqualWithOpts returns true if j1 and j2 are equal. If ignoreID is set to true, IDs will be ignored while comparison. If ignoreTS is set to true, timestamp fields will be ignored.
func (*MTLSAuth) GetConsumer ¶ added in v1.2.0
func (*MTLSAuth) GetID ¶ added in v1.2.0
GetID returns ID. If ID is empty, it returns an empty string.
func (*MTLSAuth) GetID2 ¶ added in v1.2.0
GetID2 returns the endpoint key of the entity, BUT NO SUCH THING EXISTS 😱 TODO: this is kind of a pointless clone of GetID for MTLSAuth. the mtls-auth entity cannot be referenced by anything other than its ID (it has no unique fields), but the entity interface requires this function. this duplication doesn't appear to be harmful, but it's weird.
type MTLSAuthsCollection ¶ added in v1.2.0
type MTLSAuthsCollection struct {
// contains filtered or unexported fields
}
MTLSAuthsCollection stores and indexes mtls-auth credentials.
func (*MTLSAuthsCollection) Add ¶ added in v1.2.0
func (k *MTLSAuthsCollection) Add(mtlsAuth MTLSAuth) error
Add adds a mtls-auth credential to MTLSAuthsCollection
func (*MTLSAuthsCollection) Delete ¶ added in v1.2.0
func (k *MTLSAuthsCollection) Delete(ID string) error
Delete deletes a mtls-auth credential by ID.
func (*MTLSAuthsCollection) Get ¶ added in v1.2.0
func (k *MTLSAuthsCollection) Get(ID string) (*MTLSAuth, error)
Get gets a mtls-auth credential by ID.
func (*MTLSAuthsCollection) GetAll ¶ added in v1.2.0
func (k *MTLSAuthsCollection) GetAll() ([]*MTLSAuth, error)
GetAll gets all mtls-auth credentials.
func (*MTLSAuthsCollection) GetAllByConsumerID ¶ added in v1.2.0
func (k *MTLSAuthsCollection) GetAllByConsumerID(id string) ([]*MTLSAuth, error)
GetAllByConsumerID returns all mtls-auth credentials belong to a Consumer with id.
func (*MTLSAuthsCollection) Schema ¶ added in v1.2.0
func (k *MTLSAuthsCollection) Schema() *memdb.TableSchema
func (*MTLSAuthsCollection) TableName ¶ added in v1.2.0
func (k *MTLSAuthsCollection) TableName() string
func (*MTLSAuthsCollection) Update ¶ added in v1.2.0
func (k *MTLSAuthsCollection) Update(mtlsAuth MTLSAuth) error
Update updates an existing mtls-auth credential.
type Meta ¶
type Meta struct {
// contains filtered or unexported fields
}
Meta stores metadata for any entity.
type Oauth2Credential ¶ added in v0.5.1
type Oauth2Credential struct { kong.Oauth2Credential `yaml:",inline"` Meta }
Oauth2Credential represents an Oauth2 credential in Kong. It adds some helper methods along with Meta to the original Oauth2Credential object.
func (*Oauth2Credential) Console ¶ added in v0.7.0
func (k1 *Oauth2Credential) Console() string
Console returns an entity's identity in a human readable string.
func (*Oauth2Credential) Equal ¶ added in v0.5.1
func (k1 *Oauth2Credential) Equal(k2 *Oauth2Credential) bool
Equal returns true if k1 and k2 are equal.
func (*Oauth2Credential) EqualWithOpts ¶ added in v0.5.1
func (k1 *Oauth2Credential) EqualWithOpts(k2 *Oauth2Credential, ignoreID, ignoreTS, ignoreForeign bool) bool
EqualWithOpts returns true if k1 and k2 are equal. If ignoreID is set to true, IDs will be ignored while comparison. If ignoreTS is set to true, timestamp fields will be ignored.
func (*Oauth2Credential) GetConsumer ¶ added in v0.6.0
func (k1 *Oauth2Credential) GetConsumer() string
GetConsumer returns the credential's Consumer's ID. If Consumer's ID is empty, it returns an empty string.
func (*Oauth2Credential) GetID ¶ added in v0.6.0
func (k1 *Oauth2Credential) GetID() string
GetID returns ID. If ID is empty, it returns an empty string.
func (*Oauth2Credential) GetID2 ¶ added in v0.6.0
func (k1 *Oauth2Credential) GetID2() string
GetID2 returns the endpoint key of the entity, the ClientID field for Oauth2Credential.
type Oauth2CredsCollection ¶ added in v0.5.1
type Oauth2CredsCollection struct {
// contains filtered or unexported fields
}
Oauth2CredsCollection stores and indexes oauth2 credentials.
func (*Oauth2CredsCollection) Add ¶ added in v0.5.1
func (k *Oauth2CredsCollection) Add(keyAuth Oauth2Credential) error
Add adds a oauth2 credential to Oauth2CredsCollection
func (*Oauth2CredsCollection) Delete ¶ added in v0.5.1
func (k *Oauth2CredsCollection) Delete(keyOrID string) error
Delete deletes a oauth2 credential by key or ID.
func (*Oauth2CredsCollection) Get ¶ added in v0.5.1
func (k *Oauth2CredsCollection) Get(keyOrID string) (*Oauth2Credential, error)
Get gets a oauth2 credential by key or ID.
func (*Oauth2CredsCollection) GetAll ¶ added in v0.5.1
func (k *Oauth2CredsCollection) GetAll() ([]*Oauth2Credential, error)
GetAll gets all oauth2 credentials.
func (*Oauth2CredsCollection) GetAllByConsumerID ¶ added in v0.5.1
func (k *Oauth2CredsCollection) GetAllByConsumerID(id string) ([]*Oauth2Credential, error)
GetAllByConsumerID returns all oauth2 credentials belong to a Consumer with id.
func (*Oauth2CredsCollection) Schema ¶ added in v0.6.0
func (k *Oauth2CredsCollection) Schema() *memdb.TableSchema
func (*Oauth2CredsCollection) TableName ¶ added in v0.6.0
func (k *Oauth2CredsCollection) TableName() string
func (*Oauth2CredsCollection) Update ¶ added in v0.5.1
func (k *Oauth2CredsCollection) Update(keyAuth Oauth2Credential) error
Update updates an existing oauth2 credential.
type Plugin ¶
Plugin represents a route in Kong. It adds some helper methods along with Meta to the original Plugin object.
func (*Plugin) Console ¶ added in v0.7.0
Console returns an entity's identity in a human readable string.
func (*Plugin) Equal ¶
Equal returns true if r1 and r2 are equal. TODO add compare array without position
func (*Plugin) EqualWithOpts ¶
EqualWithOpts returns true if p1 and p2 are equal. If ignoreID is set to true, IDs will be ignored while comparison. If ignoreTS is set to true, timestamp fields will be ignored.
func (*Plugin) Identifier ¶ added in v0.6.0
Identifier returns the endpoint key name or ID.
type PluginsCollection ¶
type PluginsCollection collection
PluginsCollection stores and indexes Kong Services.
func (*PluginsCollection) Add ¶
func (k *PluginsCollection) Add(plugin Plugin) error
Add adds a plugin to PluginsCollection
func (*PluginsCollection) Delete ¶
func (k *PluginsCollection) Delete(id string) error
Delete deletes a plugin by ID.
func (*PluginsCollection) Get ¶
func (k *PluginsCollection) Get(id string) (*Plugin, error)
Get gets a plugin by id.
func (*PluginsCollection) GetAll ¶
func (k *PluginsCollection) GetAll() ([]*Plugin, error)
GetAll gets a plugin by name or ID.
func (*PluginsCollection) GetAllByConsumerID ¶ added in v0.2.0
func (k *PluginsCollection) GetAllByConsumerID(id string) ([]*Plugin, error)
GetAllByConsumerID returns all plugins referencing a consumer by its id.
func (*PluginsCollection) GetAllByName ¶
func (k *PluginsCollection) GetAllByName(name string) ([]*Plugin, error)
GetAllByName returns all plugins of a specific type (key-auth, ratelimiting, etc).
func (*PluginsCollection) GetAllByRouteID ¶
func (k *PluginsCollection) GetAllByRouteID(id string) ([]*Plugin, error)
GetAllByRouteID returns all plugins referencing a service by its id.
func (*PluginsCollection) GetAllByServiceID ¶
func (k *PluginsCollection) GetAllByServiceID(id string) ([]*Plugin, error)
GetAllByServiceID returns all plugins referencing a service by its id.
func (*PluginsCollection) GetByProp ¶
func (k *PluginsCollection) GetByProp(name, serviceID, routeID string, consumerID string) (*Plugin, error)
GetByProp returns a plugin which matches all the properties passed in the arguments. If serviceID, routeID and consumerID are empty strings, then a global plugin is searched. Otherwise, a plugin with name and the supplied foreign references is searched. name is required.
func (*PluginsCollection) Update ¶
func (k *PluginsCollection) Update(plugin Plugin) error
Update updates a plugin
type Route ¶
Route represents a route in Kong. It adds some helper methods along with Meta to the original Route object.
func (*Route) Console ¶ added in v0.7.0
Console returns an entity's identity in a human readable string.
func (*Route) Equal ¶
Equal returns true if r1 and r2 are equal. TODO add compare array without position
func (*Route) EqualWithOpts ¶
EqualWithOpts returns true if r1 and r2 are equal. If ignoreID is set to true, IDs will be ignored while comparison. If ignoreTS is set to true, timestamp fields will be ignored.
func (*Route) Identifier ¶ added in v0.6.0
Identifier returns the endpoint key name or ID.
type RoutesCollection ¶
type RoutesCollection collection
RoutesCollection stores and indexes Kong Routes.
func (*RoutesCollection) Add ¶
func (k *RoutesCollection) Add(route Route) error
Add adds a route into RoutesCollection route.ID should not be nil else an error is thrown.
func (*RoutesCollection) Delete ¶
func (k *RoutesCollection) Delete(nameOrID string) error
Delete deletes a route by name or ID.
func (*RoutesCollection) Get ¶
func (k *RoutesCollection) Get(nameOrID string) (*Route, error)
Get gets a route by name or ID.
func (*RoutesCollection) GetAll ¶
func (k *RoutesCollection) GetAll() ([]*Route, error)
GetAll gets a route by name or ID.
func (*RoutesCollection) GetAllByServiceID ¶
func (k *RoutesCollection) GetAllByServiceID(id string) ([]*Route, error)
GetAllByServiceID returns all routes referencing a service by its id.
func (*RoutesCollection) Update ¶
func (k *RoutesCollection) Update(route Route) error
Update updates a route
type SNI ¶
SNI represents a SNI in Kong. It adds some helper methods along with Meta to the original SNI object.
func (*SNI) Console ¶ added in v0.7.0
Console returns an entity's identity in a human readable string.
func (*SNI) Equal ¶
Equal returns true if s1 and s2 are equal. TODO add compare array without position
func (*SNI) EqualWithOpts ¶
EqualWithOpts returns true if s1 and s2 are equal. If ignoreID is set to true, IDs will be ignored while comparison. If ignoreTS is set to true, timestamp fields will be ignored.
func (*SNI) Identifier ¶ added in v0.6.0
Identifier returns the endpoint key name or ID.
type SNIsCollection ¶ added in v1.1.0
type SNIsCollection collection
SNIsCollection stores and indexes Kong SNIs.
func (*SNIsCollection) Add ¶ added in v1.1.0
func (k *SNIsCollection) Add(sni SNI) error
Add adds a sni into SNIsCollection sni.ID should not be nil else an error is thrown.
func (*SNIsCollection) Delete ¶ added in v1.1.0
func (k *SNIsCollection) Delete(nameOrID string) error
Delete deletes a sni by name or ID.
func (*SNIsCollection) Get ¶ added in v1.1.0
func (k *SNIsCollection) Get(nameOrID string) (*SNI, error)
Get gets a sni by name or ID.
func (*SNIsCollection) GetAll ¶ added in v1.1.0
func (k *SNIsCollection) GetAll() ([]*SNI, error)
GetAll gets a sni by name or ID.
func (*SNIsCollection) GetAllByCertID ¶ added in v1.1.0
func (k *SNIsCollection) GetAllByCertID(id string) ([]*SNI, error)
GetAllByCertID returns all routes referencing a service by its id.
func (*SNIsCollection) Update ¶ added in v1.1.0
func (k *SNIsCollection) Update(sni SNI) error
Update updates a sni
type Service ¶
Service represents a service in Kong. It adds some helper methods along with Meta to the original Service object.
func (*Service) Console ¶ added in v0.7.0
Console returns an entity's identity in a human readable string.
func (*Service) EqualWithOpts ¶
EqualWithOpts returns true if s1 and s2 are equal. If ignoreID is set to true, IDs will be ignored while comparison. If ignoreTS is set to true, timestamp fields will be ignored.
func (*Service) Identifier ¶ added in v0.6.0
Identifier returns the endpoint key name or ID.
type ServicesCollection ¶
type ServicesCollection collection
ServicesCollection stores and indexes Kong Services.
func (*ServicesCollection) Add ¶
func (k *ServicesCollection) Add(service Service) error
Add adds a service to the collection. service.ID should not be nil else an error is thrown.
func (*ServicesCollection) Delete ¶
func (k *ServicesCollection) Delete(nameOrID string) error
Delete deletes a service by name or ID.
func (*ServicesCollection) Get ¶
func (k *ServicesCollection) Get(nameOrID string) (*Service, error)
Get gets a service by name or ID.
func (*ServicesCollection) GetAll ¶
func (k *ServicesCollection) GetAll() ([]*Service, error)
GetAll returns all the services.
func (*ServicesCollection) Update ¶
func (k *ServicesCollection) Update(service Service) error
Update udpates an existing service. It returns an error if the service is not already present.
type Target ¶
Target represents a Target in Kong. It adds some helper methods along with Meta to the original Target object.
func (*Target) Console ¶ added in v0.7.0
Console returns an entity's identity in a human readable string.
func (*Target) Equal ¶
Equal returns true if t1 and t2 are equal. TODO add compare array without position
func (*Target) EqualWithOpts ¶
EqualWithOpts returns true if t1 and t2 are equal. If ignoreID is set to true, IDs will be ignored while comparison. If ignoreTS is set to true, timestamp fields will be ignored.
func (*Target) Identifier ¶ added in v0.6.0
Identifier returns the endpoint key name or ID.
type TargetsCollection ¶
type TargetsCollection collection
TargetsCollection stores and indexes Kong Upstreams.
func (*TargetsCollection) Add ¶
func (k *TargetsCollection) Add(target Target) error
Add adds a target to TargetsCollection. target should have an ID, Target and it's upstream's ID is set.
func (*TargetsCollection) Delete ¶
func (k *TargetsCollection) Delete(upstreamID, targetOrID string) error
Delete deletes a target by its ID.
func (*TargetsCollection) Get ¶
func (k *TargetsCollection) Get(upstreamID, targetOrID string) (*Target, error)
Get returns a specific target for upstream with upstreamID.
func (*TargetsCollection) GetAll ¶
func (k *TargetsCollection) GetAll() ([]*Target, error)
GetAll gets a target by Target or ID.
func (*TargetsCollection) GetAllByUpstreamID ¶
func (k *TargetsCollection) GetAllByUpstreamID(id string) ([]*Target, error)
GetAllByUpstreamID returns all targets referencing a Upstream by its ID.
func (*TargetsCollection) Update ¶
func (k *TargetsCollection) Update(target Target) error
Update updates a target
type Upstream ¶
Upstream represents a upstream in Kong. It adds some helper methods along with Meta to the original Upstream object.
func (*Upstream) Console ¶ added in v0.7.0
Console returns an entity's identity in a human readable string.
func (*Upstream) EqualWithOpts ¶
EqualWithOpts returns true if u1 and u2 are equal. If ignoreID is set to true, IDs will be ignored while comparison. If ignoreTS is set to true, timestamp fields will be ignored.
func (*Upstream) Identifier ¶ added in v0.6.0
Identifier returns the endpoint key name or ID.
type UpstreamsCollection ¶
type UpstreamsCollection collection
UpstreamsCollection stores and indexes Kong Upstreams.
func (*UpstreamsCollection) Add ¶
func (k *UpstreamsCollection) Add(upstream Upstream) error
Add adds an upstream to the collection. upstream.ID should not be nil else an error is thrown.
func (*UpstreamsCollection) Delete ¶
func (k *UpstreamsCollection) Delete(nameOrID string) error
Delete deletes an upstream by it's name or ID.
func (*UpstreamsCollection) Get ¶
func (k *UpstreamsCollection) Get(nameOrID string) (*Upstream, error)
Get gets an upstream by name or ID.
func (*UpstreamsCollection) GetAll ¶
func (k *UpstreamsCollection) GetAll() ([]*Upstream, error)
GetAll gets all upstreams in the state.
func (*UpstreamsCollection) Update ¶
func (k *UpstreamsCollection) Update(upstream Upstream) error
Update udpates an existing upstream.