state

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyExists = fmt.Errorf("entity already exists")

ErrAlreadyExists represents an entity is already present in the state.

View Source
var ErrNotFound = fmt.Errorf("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

type ACLGroup struct {
	kong.ACLGroup `yaml:",inline"`
	Meta
}

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

func (b1 *ACLGroup) Console() string

Console returns an entity's identity in a human readable string.

func (*ACLGroup) Equal

func (b1 *ACLGroup) Equal(b2 *ACLGroup) bool

Equal returns true if b1 and b2 are equal.

func (*ACLGroup) EqualWithOpts

func (b1 *ACLGroup) EqualWithOpts(b2 *ACLGroup, ignoreID,
	ignoreTS, 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.

type ACLGroupsCollection

type ACLGroupsCollection collection

ACLGroupsCollection stores and indexes acl-group credentials.

func (*ACLGroupsCollection) Add

func (k *ACLGroupsCollection) Add(aclGroup ACLGroup) error

Add adds aclGroup to ACLGroupsCollection

func (*ACLGroupsCollection) Delete

func (k *ACLGroupsCollection) Delete(id string) error

Delete deletes an acl-group by id.

func (*ACLGroupsCollection) Get

func (k *ACLGroupsCollection) Get(consumerID,
	groupOrID string,
) (*ACLGroup, error)

Get gets a acl-group for a consumer by group or ID.

func (*ACLGroupsCollection) GetAll

func (k *ACLGroupsCollection) GetAll() ([]*ACLGroup, error)

GetAll gets all acl-groups.

func (*ACLGroupsCollection) GetAllByConsumerID

func (k *ACLGroupsCollection) GetAllByConsumerID(id string) ([]*ACLGroup,
	error,
)

GetAllByConsumerID returns all acl-group credentials belong to a Consumer with id.

func (*ACLGroupsCollection) GetByID

func (k *ACLGroupsCollection) GetByID(id string) (*ACLGroup, error)

GetByID gets an acl-group with id.

func (*ACLGroupsCollection) Update

func (k *ACLGroupsCollection) Update(aclGroup ACLGroup) error

Update updates an existing acl-group credential.

type BasicAuth

type BasicAuth struct {
	kong.BasicAuth `yaml:",inline"`
	Meta
}

BasicAuth represents a basic-auth credential in Kong. It adds some helper methods along with Meta to the original BasicAuth object.

func (*BasicAuth) Console

func (b1 *BasicAuth) Console() string

Console returns an entity's identity in a human readable string.

func (*BasicAuth) Equal

func (b1 *BasicAuth) Equal(b2 *BasicAuth) bool

Equal returns true if b1 and b2 are equal.

func (*BasicAuth) EqualWithOpts

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

func (b1 *BasicAuth) GetConsumer() string

GetConsumer returns the credential's Consumer's ID. If Consumer's ID is empty, it returns an empty string.

func (*BasicAuth) GetID

func (b1 *BasicAuth) GetID() string

GetID returns ID. If ID is empty, it returns an empty string.

func (*BasicAuth) GetID2

func (b1 *BasicAuth) GetID2() string

GetID2 returns the endpoint key of the entity, the Username field for BasicAuth.

type BasicAuthsCollection

type BasicAuthsCollection struct {
	// contains filtered or unexported fields
}

BasicAuthsCollection stores and indexes basic-auth credentials.

func (*BasicAuthsCollection) Add

func (k *BasicAuthsCollection) Add(basicAuth BasicAuth) error

Add adds a basic-auth credential to BasicAuthsCollection

func (*BasicAuthsCollection) Delete

func (k *BasicAuthsCollection) Delete(keyOrID string) error

Delete deletes a basic-auth credential by key or ID.

func (*BasicAuthsCollection) Get

func (k *BasicAuthsCollection) Get(keyOrID string) (*BasicAuth, error)

Get gets a basic-auth credential by key or ID.

func (*BasicAuthsCollection) GetAll

func (k *BasicAuthsCollection) GetAll() ([]*BasicAuth, error)

GetAll gets all basic-auth credentials.

func (*BasicAuthsCollection) GetAllByConsumerID

func (k *BasicAuthsCollection) GetAllByConsumerID(id string) ([]*BasicAuth,
	error,
)

GetAllByConsumerID returns all basic-auth credentials belong to a Consumer with id.

func (*BasicAuthsCollection) Schema

func (k *BasicAuthsCollection) Schema() *memdb.TableSchema

func (*BasicAuthsCollection) TableName

func (k *BasicAuthsCollection) TableName() string

func (*BasicAuthsCollection) Update

func (k *BasicAuthsCollection) Update(basicAuth BasicAuth) error

Update updates an existing basic-auth credential.

type CACertificate

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

func (c1 *CACertificate) Console() string

Console returns an entity's identity in a human readable string.

func (*CACertificate) Equal

func (c1 *CACertificate) Equal(c2 *CACertificate) bool

Equal returns true if c1 and c2 are equal.

func (*CACertificate) EqualWithOpts

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

func (c1 *CACertificate) Identifier() string

Identifier returns the endpoint key name or ID.

type CACertificatesCollection

type CACertificatesCollection collection

CACertificatesCollection stores and indexes Kong CACertificates.

func (*CACertificatesCollection) Add

Add adds a caCert to the collection

func (*CACertificatesCollection) Delete

func (k *CACertificatesCollection) Delete(certOrID string) error

Delete deletes a caCertificate by looking up it's cert and key.

func (*CACertificatesCollection) Get

func (k *CACertificatesCollection) Get(certOrID string) (*CACertificate, error)

Get gets a caCertificate by cert or ID.

func (*CACertificatesCollection) GetAll

func (k *CACertificatesCollection) GetAll() ([]*CACertificate, error)

GetAll gets a caCertificate by name or ID.

func (*CACertificatesCollection) Update

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

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

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

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

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

type Consumer struct {
	kong.Consumer `yaml:",inline"`
	Meta
}

Consumer represents a consumer in Kong. It adds some helper methods along with Meta to the original Consumer object.

func (*Consumer) Console

func (c1 *Consumer) Console() string

Console returns an entity's identity in a human readable string.

func (*Consumer) Equal

func (c1 *Consumer) Equal(c2 *Consumer) bool

Equal returns true if c1 and c2 are equal.

func (*Consumer) EqualWithOpts

func (c1 *Consumer) EqualWithOpts(c2 *Consumer,
	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 (*Consumer) Identifier

func (c1 *Consumer) Identifier() string

Identifier returns the endpoint key name or ID.

type ConsumerGroup

type ConsumerGroup struct {
	kong.ConsumerGroup `yaml:",inline"`
	Meta
}

ConsumerGroup represents a ConsumerGroup in Kong. It adds some helper methods along with Meta to the original ConsumerGroup object.

func (*ConsumerGroup) Console

func (c1 *ConsumerGroup) Console() string

Console returns an entity's identity in a human readable string.

func (*ConsumerGroup) Equal

func (c1 *ConsumerGroup) Equal(c2 *ConsumerGroup) bool

Equal returns true if c1 and c2 are equal.

func (*ConsumerGroup) EqualWithOpts

func (c1 *ConsumerGroup) EqualWithOpts(c2 *ConsumerGroup,
	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 (*ConsumerGroup) Identifier

func (c1 *ConsumerGroup) Identifier() string

Identifier returns the endpoint key name or ID.

type ConsumerGroupConsumer

type ConsumerGroupConsumer struct {
	kong.ConsumerGroupConsumer `yaml:",inline"`
	Meta
}

ConsumerGroupConsumer represents a ConsumerGroupConsumer in Kong. It adds some helper methods along with Meta to the original ConsumerGroupConsumer object.

func (*ConsumerGroupConsumer) Console

func (c1 *ConsumerGroupConsumer) Console() string

Console returns an entity's identity in a human readable string.

func (*ConsumerGroupConsumer) Equal

Equal returns true if c1 and c2 are equal.

func (*ConsumerGroupConsumer) EqualWithOpts

func (c1 *ConsumerGroupConsumer) EqualWithOpts(c2 *ConsumerGroupConsumer,
	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 (*ConsumerGroupConsumer) Identifier

func (c1 *ConsumerGroupConsumer) Identifier() string

Identifier returns the endpoint key Ursername or ID.

type ConsumerGroupConsumersCollection

type ConsumerGroupConsumersCollection collection

ConsumerGroupConsumersCollection stores and indexes Kong consumerGroupConsumers.

func (*ConsumerGroupConsumersCollection) Add

Add adds a consumerGroupConsumer to the collection.

func (*ConsumerGroupConsumersCollection) Delete

func (k *ConsumerGroupConsumersCollection) Delete(nameOrID, consumerGroupID string) error

Delete deletes a consumerGroupConsumer by its username or ID.

func (*ConsumerGroupConsumersCollection) Get

func (k *ConsumerGroupConsumersCollection) Get(
	nameOrID, consumerGroupID string,
) (*ConsumerGroupConsumer, error)

Get gets a consumerGroupConsumer.

func (*ConsumerGroupConsumersCollection) GetAll

GetAll gets all consumerGroupConsumers in the state.

func (*ConsumerGroupConsumersCollection) Update

Update udpates an existing consumerGroupConsumer.

type ConsumerGroupObject

type ConsumerGroupObject struct {
	kong.ConsumerGroupObject `yaml:",inline"`
	Meta
}

ConsumerGroupObject represents a ConsumerGroupObject in Kong. It adds some helper methods along with Meta to the original Upstream object.

func (*ConsumerGroupObject) Console

func (c1 *ConsumerGroupObject) Console() string

Console returns an entity's identity in a human readable string.

func (*ConsumerGroupObject) Equal

Equal returns true if u1 and u2 are equal.

func (*ConsumerGroupObject) EqualWithOpts

func (c1 *ConsumerGroupObject) EqualWithOpts(c2 *ConsumerGroupObject,
	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 (*ConsumerGroupObject) Identifier

func (c1 *ConsumerGroupObject) Identifier() string

Identifier returns the endpoint key name or ID.

type ConsumerGroupPlugin

type ConsumerGroupPlugin struct {
	kong.ConsumerGroupPlugin `yaml:",inline"`
	Meta
}

ConsumerGroupPlugin represents a ConsumerGroupConsumer in Kong. It adds some helper methods along with Meta to the original ConsumerGroupConsumer object.

func (*ConsumerGroupPlugin) Console

func (c1 *ConsumerGroupPlugin) Console() string

Console returns an entity's identity in a human readable string.

func (*ConsumerGroupPlugin) Equal

Equal returns true if c1 and c2 are equal.

func (*ConsumerGroupPlugin) EqualWithOpts

func (c1 *ConsumerGroupPlugin) EqualWithOpts(c2 *ConsumerGroupPlugin,
	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 (*ConsumerGroupPlugin) Identifier

func (c1 *ConsumerGroupPlugin) Identifier() string

Identifier returns the endpoint key name or ID.

type ConsumerGroupPluginsCollection

type ConsumerGroupPluginsCollection collection

ConsumerGroupPluginsCollection stores and indexes Kong consumerGroupPlugins.

func (*ConsumerGroupPluginsCollection) Add

Add adds a consumerGroupPlugin to the collection.

func (*ConsumerGroupPluginsCollection) Delete

func (k *ConsumerGroupPluginsCollection) Delete(nameOrID, consumerGroupID string) error

Delete deletes a consumerGroupPlugin by its username or ID.

func (*ConsumerGroupPluginsCollection) Get

func (k *ConsumerGroupPluginsCollection) Get(
	nameOrID, consumerGroupID string,
) (*ConsumerGroupPlugin, error)

Get gets a consumerGroupPlugin.

func (*ConsumerGroupPluginsCollection) GetAll

GetAll gets all consumerGroupPlugins in the state.

func (*ConsumerGroupPluginsCollection) Update

Update udpates an existing consumerGroupPlugin.

type ConsumerGroupsCollection

type ConsumerGroupsCollection collection

consumerGroupsCollection stores and indexes Kong consumerGroups.

func (*ConsumerGroupsCollection) Add

func (k *ConsumerGroupsCollection) Add(consumerGroup ConsumerGroup) error

Add adds an consumerGroup to the collection. consumerGroup.ID should not be nil else an error is thrown.

func (*ConsumerGroupsCollection) Delete

func (k *ConsumerGroupsCollection) Delete(nameOrID string) error

Delete deletes an consumerGroup by its name or ID.

func (*ConsumerGroupsCollection) Get

func (k *ConsumerGroupsCollection) Get(nameOrID string) (*ConsumerGroup, error)

Get gets an consumerGroup by name or ID.

func (*ConsumerGroupsCollection) GetAll

func (k *ConsumerGroupsCollection) GetAll() ([]*ConsumerGroup, error)

GetAll gets all consumerGroups in the state.

func (*ConsumerGroupsCollection) Update

func (k *ConsumerGroupsCollection) Update(consumerGroup ConsumerGroup) error

Update updates an existing consumerGroup.

type ConsumersCollection

type ConsumersCollection collection

ConsumersCollection stores and indexes Kong Consumers.

func (*ConsumersCollection) Add

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

func (k *ConsumersCollection) Delete(userNameOrID string) error

Delete deletes a consumer by name or ID.

func (*ConsumersCollection) GetAll

func (k *ConsumersCollection) GetAll() ([]*Consumer, error)

GetAll gets a consumer by name or ID.

func (*ConsumersCollection) GetByCustomID

func (k *ConsumersCollection) GetByCustomID(customID string) (*Consumer, error)

GetByCustomID gets a consumer by customID.

func (*ConsumersCollection) GetByIDOrUsername

func (k *ConsumersCollection) GetByIDOrUsername(userNameOrID string) (*Consumer, error)

GetByIDOrUsername gets a consumer by name or ID.

func (*ConsumersCollection) Update

func (k *ConsumersCollection) Update(consumer Consumer) error

Update udpates an existing consumer. It returns an error if the consumer is not already present.

type Document

type Document struct {
	konnect.Document `yaml:",inline"`
	Meta
}

Document represents a document in Konnect. It adds some helper methods along with Meta to the original Document object.

func (*Document) Console

func (d1 *Document) Console() string

Console returns an entity's identity in a human-readable string.

func (*Document) Equal

func (d1 *Document) Equal(d2 *Document) bool

Equal returns true if s1 and s2 are equal.

func (*Document) EqualWithOpts

func (d1 *Document) EqualWithOpts(d2 *Document,
	ignoreID, _, ignoreForeign bool,
) bool

EqualWithOpts returns true if d1 and d2 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 (*Document) Identifier

func (d1 *Document) Identifier() string

Identifier returns the endpoint key name or ID.

type DocumentsCollection

type DocumentsCollection collection

DocumentsCollection stores and indexes key-auth credentials.

func (*DocumentsCollection) Add

func (k *DocumentsCollection) Add(document Document) error

Add adds a document into DocumentsCollection document.ID should not be nil else an error is thrown.

func (*DocumentsCollection) DeleteByParent

func (k *DocumentsCollection) DeleteByParent(parent konnect.ParentInfoer, pathOrID string) error

DeleteByParent deletes a Document by parent and path or ID.

func (*DocumentsCollection) GetAll

func (k *DocumentsCollection) GetAll() ([]*Document, error)

GetAll gets all Documents.

func (*DocumentsCollection) GetAllByParent

func (k *DocumentsCollection) GetAllByParent(parent konnect.ParentInfoer) ([]*Document, error)

GetAllByParent returns all documents for a Parent

func (*DocumentsCollection) GetByParent

func (k *DocumentsCollection) GetByParent(parent konnect.ParentInfoer, pathOrID string) (*Document, error)

GetByParent returns a document attached to a Parent with a given path or ID

func (*DocumentsCollection) Update

func (k *DocumentsCollection) Update(document Document) error

Update updates a Document

type HMACAuth

type HMACAuth struct {
	kong.HMACAuth `yaml:",inline"`
	Meta
}

HMACAuth represents a key-auth credential in Kong. It adds some helper methods along with Meta to the original HMACAuth object.

func (*HMACAuth) Console

func (h1 *HMACAuth) Console() string

Console returns an entity's identity in a human readable string.

func (*HMACAuth) Equal

func (h1 *HMACAuth) Equal(h2 *HMACAuth) bool

Equal returns true if h1 and h2 are equal.

func (*HMACAuth) EqualWithOpts

func (h1 *HMACAuth) EqualWithOpts(h2 *HMACAuth, ignoreID,
	ignoreTS, ignoreForeign bool,
) bool

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

func (h1 *HMACAuth) GetConsumer() string

GetConsumer returns the credential's Consumer's ID. If Consumer's ID is empty, it returns an empty string.

func (*HMACAuth) GetID

func (h1 *HMACAuth) GetID() string

GetID returns ID. If ID is empty, it returns an empty string.

func (*HMACAuth) GetID2

func (h1 *HMACAuth) GetID2() string

GetID2 returns the endpoint key of the entity, the Username field for HMACAuth.

type HMACAuthsCollection

type HMACAuthsCollection struct {
	// contains filtered or unexported fields
}

HMACAuthsCollection stores and indexes hmac-auth credentials.

func (*HMACAuthsCollection) Add

func (k *HMACAuthsCollection) Add(hmacAuth HMACAuth) error

Add adds a hmac-auth credential to HMACAuthsCollection

func (*HMACAuthsCollection) Delete

func (k *HMACAuthsCollection) Delete(keyOrID string) error

Delete deletes a hmac-auth credential by key or ID.

func (*HMACAuthsCollection) Get

func (k *HMACAuthsCollection) Get(keyOrID string) (*HMACAuth, error)

Get gets a hmac-auth credential by key or ID.

func (*HMACAuthsCollection) GetAll

func (k *HMACAuthsCollection) GetAll() ([]*HMACAuth, error)

GetAll gets all hmac-auth credentials.

func (*HMACAuthsCollection) GetAllByConsumerID

func (k *HMACAuthsCollection) GetAllByConsumerID(id string) ([]*HMACAuth,
	error,
)

GetAllByConsumerID returns all hmac-auth credentials belong to a Consumer with id.

func (*HMACAuthsCollection) Schema

func (k *HMACAuthsCollection) Schema() *memdb.TableSchema

func (*HMACAuthsCollection) TableName

func (k *HMACAuthsCollection) TableName() string

func (*HMACAuthsCollection) Update

func (k *HMACAuthsCollection) Update(hmacAuth HMACAuth) error

Update updates an existing hmac-auth credential.

type JWTAuth

type JWTAuth struct {
	kong.JWTAuth `yaml:",inline"`
	Meta
}

JWTAuth represents a jwt credential in Kong. It adds some helper methods along with Meta to the original JWTAuth object.

func (*JWTAuth) Console

func (j1 *JWTAuth) Console() string

Console returns an entity's identity in a human readable string.

func (*JWTAuth) Equal

func (j1 *JWTAuth) Equal(j2 *JWTAuth) bool

Equal returns true if j1 and j2 are equal.

func (*JWTAuth) EqualWithOpts

func (j1 *JWTAuth) EqualWithOpts(j2 *JWTAuth, ignoreID,
	ignoreTS, 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 (*JWTAuth) GetConsumer

func (j1 *JWTAuth) GetConsumer() string

GetConsumer returns the credential's Consumer's ID. If Consumer's ID is empty, it returns an empty string.

func (*JWTAuth) GetID

func (j1 *JWTAuth) GetID() string

GetID returns ID. If ID is empty, it returns an empty string.

func (*JWTAuth) GetID2

func (j1 *JWTAuth) GetID2() string

GetID2 returns the endpoint key of the entity, the Key field for JWTAuth.

type JWTAuthsCollection

type JWTAuthsCollection struct {
	// contains filtered or unexported fields
}

JWTAuthsCollection stores and indexes jwt-auth credentials.

func (*JWTAuthsCollection) Add

func (k *JWTAuthsCollection) Add(jwtAuth JWTAuth) error

Add adds a jwt-auth credential to JWTAuthsCollection

func (*JWTAuthsCollection) Delete

func (k *JWTAuthsCollection) Delete(keyOrID string) error

Delete deletes a jwt-auth credential by key or ID.

func (*JWTAuthsCollection) Get

func (k *JWTAuthsCollection) Get(keyOrID string) (*JWTAuth, error)

Get gets a jwt-auth credential by key or ID.

func (*JWTAuthsCollection) GetAll

func (k *JWTAuthsCollection) GetAll() ([]*JWTAuth, error)

GetAll gets all jwt-auth credentials.

func (*JWTAuthsCollection) GetAllByConsumerID

func (k *JWTAuthsCollection) GetAllByConsumerID(id string) ([]*JWTAuth,
	error,
)

GetAllByConsumerID returns all jwt-auth credentials belong to a Consumer with id.

func (*JWTAuthsCollection) Schema

func (k *JWTAuthsCollection) Schema() *memdb.TableSchema

func (*JWTAuthsCollection) TableName

func (k *JWTAuthsCollection) TableName() string

func (*JWTAuthsCollection) Update

func (k *JWTAuthsCollection) Update(jwtAuth JWTAuth) error

Update updates an existing jwt-auth credential.

type KeyAuth

type KeyAuth struct {
	kong.KeyAuth `yaml:",inline"`
	Meta
}

KeyAuth represents a key-auth credential in Kong. It adds some helper methods along with Meta to the original KeyAuth object.

func (*KeyAuth) Console

func (k1 *KeyAuth) Console() string

Console returns an entity's identity in a human readable string.

func (*KeyAuth) Equal

func (k1 *KeyAuth) Equal(k2 *KeyAuth) bool

Equal returns true if k1 and k2 are equal.

func (*KeyAuth) EqualWithOpts

func (k1 *KeyAuth) EqualWithOpts(k2 *KeyAuth, 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 (*KeyAuth) GetConsumer

func (k1 *KeyAuth) GetConsumer() string

GetConsumer returns the credential's Consumer's ID. If Consumer's ID is empty, it returns an empty string.

func (*KeyAuth) GetID

func (k1 *KeyAuth) GetID() string

GetID returns ID. If ID is empty, it returns an empty string.

func (*KeyAuth) GetID2

func (k1 *KeyAuth) GetID2() string

GetID2 returns the endpoint key of the entity, the Key field for KeyAuth.

type KeyAuthsCollection

type KeyAuthsCollection struct {
	// contains filtered or unexported fields
}

KeyAuthsCollection stores and indexes key-auth credentials.

func (*KeyAuthsCollection) Add

func (k *KeyAuthsCollection) Add(keyAuth KeyAuth) error

Add adds a key-auth credential to KeyAuthsCollection

func (*KeyAuthsCollection) Delete

func (k *KeyAuthsCollection) Delete(keyOrID string) error

Delete deletes a key-auth credential by key or ID.

func (*KeyAuthsCollection) Get

func (k *KeyAuthsCollection) Get(keyOrID string) (*KeyAuth, error)

Get gets a key-auth credential by key or ID.

func (*KeyAuthsCollection) GetAll

func (k *KeyAuthsCollection) GetAll() ([]*KeyAuth, error)

GetAll gets all key-auth credentials.

func (*KeyAuthsCollection) GetAllByConsumerID

func (k *KeyAuthsCollection) GetAllByConsumerID(id string) ([]*KeyAuth,
	error,
)

GetAllByConsumerID returns all key-auth credentials belong to a Consumer with id.

func (*KeyAuthsCollection) Schema

func (k *KeyAuthsCollection) Schema() *memdb.TableSchema

func (*KeyAuthsCollection) TableName

func (k *KeyAuthsCollection) TableName() string

func (*KeyAuthsCollection) Update

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
	Vaults                 *VaultsCollection
	ConsumerGroups         *ConsumerGroupsCollection
	ConsumerGroupConsumers *ConsumerGroupConsumersCollection
	ConsumerGroupPlugins   *ConsumerGroupPluginsCollection

	KeyAuths                *KeyAuthsCollection
	HMACAuths               *HMACAuthsCollection
	JWTAuths                *JWTAuthsCollection
	BasicAuths              *BasicAuthsCollection
	ACLGroups               *ACLGroupsCollection
	Oauth2Creds             *Oauth2CredsCollection
	MTLSAuths               *MTLSAuthsCollection
	RBACRoles               *RBACRolesCollection
	RBACEndpointPermissions *RBACEndpointPermissionsCollection

	// konnect-specific entities
	ServicePackages *ServicePackagesCollection
	ServiceVersions *ServiceVersionsCollection
	Documents       *DocumentsCollection
	// contains filtered or unexported fields
}

KongState is an in-memory database representation of Kong's configuration.

func Get

func Get(raw *utils.KongRawState) (*KongState, error)

Get builds a KongState from a raw representation of Kong.

func GetKonnectState

func GetKonnectState(rawKong *utils.KongRawState,
	rawKonnect *utils.KonnectRawState,
) (*KongState, error)

func NewKongState

func NewKongState() (*KongState, error)

NewKongState creates a new in-memory KongState.

type MTLSAuth

type MTLSAuth struct {
	kong.MTLSAuth `yaml:",inline"`
	Meta
}

MTLSAuth represents an mtls-auth credential in Kong. It adds some helper methods along with Meta to the original MTLSAuth object.

func (*MTLSAuth) Console

func (b1 *MTLSAuth) Console() string

Console returns an entity's identity in a human readable string.

func (*MTLSAuth) Equal

func (b1 *MTLSAuth) Equal(b2 *MTLSAuth) bool

Equal returns true if b1 and b2 are equal.

func (*MTLSAuth) EqualWithOpts

func (b1 *MTLSAuth) EqualWithOpts(b2 *MTLSAuth, ignoreID,
	ignoreTS, 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 (*MTLSAuth) GetConsumer

func (b1 *MTLSAuth) GetConsumer() string

func (*MTLSAuth) GetID

func (b1 *MTLSAuth) GetID() string

GetID returns ID. If ID is empty, it returns an empty string.

func (*MTLSAuth) GetID2

func (b1 *MTLSAuth) GetID2() string

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

type MTLSAuthsCollection struct {
	// contains filtered or unexported fields
}

MTLSAuthsCollection stores and indexes mtls-auth credentials.

func (*MTLSAuthsCollection) Add

func (k *MTLSAuthsCollection) Add(mtlsAuth MTLSAuth) error

Add adds a mtls-auth credential to MTLSAuthsCollection

func (*MTLSAuthsCollection) Delete

func (k *MTLSAuthsCollection) Delete(ID string) error

Delete deletes a mtls-auth credential by ID.

func (*MTLSAuthsCollection) Get

func (k *MTLSAuthsCollection) Get(ID string) (*MTLSAuth, error)

Get gets a mtls-auth credential by ID.

func (*MTLSAuthsCollection) GetAll

func (k *MTLSAuthsCollection) GetAll() ([]*MTLSAuth, error)

GetAll gets all mtls-auth credentials.

func (*MTLSAuthsCollection) GetAllByConsumerID

func (k *MTLSAuthsCollection) GetAllByConsumerID(id string) ([]*MTLSAuth,
	error,
)

GetAllByConsumerID returns all mtls-auth credentials belong to a Consumer with id.

func (*MTLSAuthsCollection) Schema

func (k *MTLSAuthsCollection) Schema() *memdb.TableSchema

func (*MTLSAuthsCollection) TableName

func (k *MTLSAuthsCollection) TableName() string

func (*MTLSAuthsCollection) Update

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.

func (*Meta) AddMeta

func (m *Meta) AddMeta(key string, obj interface{})

AddMeta adds key->obj metadata. It will override the old obj in key is already present.

func (*Meta) GetMeta

func (m *Meta) GetMeta(key string) interface{}

GetMeta returns the obj previously added using AddMeta(). It returns nil if key is not present.

type Oauth2Credential

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

func (k1 *Oauth2Credential) Console() string

Console returns an entity's identity in a human readable string.

func (*Oauth2Credential) Equal

func (k1 *Oauth2Credential) Equal(k2 *Oauth2Credential) bool

Equal returns true if k1 and k2 are equal.

func (*Oauth2Credential) EqualWithOpts

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

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

func (k1 *Oauth2Credential) GetID() string

GetID returns ID. If ID is empty, it returns an empty string.

func (*Oauth2Credential) GetID2

func (k1 *Oauth2Credential) GetID2() string

GetID2 returns the endpoint key of the entity, the ClientID field for Oauth2Credential.

type Oauth2CredsCollection

type Oauth2CredsCollection struct {
	// contains filtered or unexported fields
}

Oauth2CredsCollection stores and indexes oauth2 credentials.

func (*Oauth2CredsCollection) Add

Add adds a oauth2 credential to Oauth2CredsCollection

func (*Oauth2CredsCollection) Delete

func (k *Oauth2CredsCollection) Delete(keyOrID string) error

Delete deletes a oauth2 credential by key or ID.

func (*Oauth2CredsCollection) Get

func (k *Oauth2CredsCollection) Get(keyOrID string) (*Oauth2Credential, error)

Get gets a oauth2 credential by key or ID.

func (*Oauth2CredsCollection) GetAll

func (k *Oauth2CredsCollection) GetAll() ([]*Oauth2Credential, error)

GetAll gets all oauth2 credentials.

func (*Oauth2CredsCollection) GetAllByConsumerID

func (k *Oauth2CredsCollection) GetAllByConsumerID(id string) ([]*Oauth2Credential,
	error,
)

GetAllByConsumerID returns all oauth2 credentials belong to a Consumer with id.

func (*Oauth2CredsCollection) Schema

func (k *Oauth2CredsCollection) Schema() *memdb.TableSchema

func (*Oauth2CredsCollection) TableName

func (k *Oauth2CredsCollection) TableName() string

func (*Oauth2CredsCollection) Update

func (k *Oauth2CredsCollection) Update(keyAuth Oauth2Credential) error

Update updates an existing oauth2 credential.

type Plugin

type Plugin struct {
	kong.Plugin `yaml:",inline"`
	Meta
}

Plugin represents a route in Kong. It adds some helper methods along with Meta to the original Plugin object.

func (*Plugin) Console

func (p1 *Plugin) Console() string

Console returns an entity's identity in a human readable string.

func (*Plugin) Equal

func (p1 *Plugin) Equal(p2 *Plugin) bool

Equal returns true if r1 and r2 are equal. TODO add compare array without position

func (*Plugin) EqualWithOpts

func (p1 *Plugin) EqualWithOpts(p2 *Plugin, ignoreID,
	ignoreTS, ignoreForeign bool,
) bool

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

func (p1 *Plugin) Identifier() string

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) GetAllByConsumerGroupID

func (k *PluginsCollection) GetAllByConsumerGroupID(id string) ([]*Plugin,
	error,
)

GetAllByConsumerGroupID returns all plugins referencing a consumer-group by its id.

func (*PluginsCollection) GetAllByConsumerID

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 route 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, consumerID, consumerGroupID string,
) (*Plugin, error)

GetByProp returns a plugin which matches all the properties passed in the arguments. If serviceID, routeID, consumerID and consumerGroupID 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 RBACEndpointPermission

type RBACEndpointPermission struct {
	ID                          string
	kong.RBACEndpointPermission `yaml:",inline"`
	Meta
}

RBACEndpointPermission represents an RBAC Role in Kong. It adds some helper methods along with Meta to the original RBACEndpointPermission object.

func (*RBACEndpointPermission) Console

func (r1 *RBACEndpointPermission) Console() string

Console returns an entity's identity in a human readable string.

func (*RBACEndpointPermission) Equal

Equal returns true if r1 and r2 are equal. TODO add compare array without position

func (*RBACEndpointPermission) EqualWithOpts

func (r1 *RBACEndpointPermission) EqualWithOpts(r2 *RBACEndpointPermission, ignoreID,
	ignoreTS, _ bool,
) bool

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 (*RBACEndpointPermission) Identifier

func (r1 *RBACEndpointPermission) Identifier() string

Identifier returns a composite ID base on Role ID, workspace, and endpoint

type RBACEndpointPermissionsCollection

type RBACEndpointPermissionsCollection collection

RBACEndpointPermissionsCollection stores and indexes Kong RBACEndpointPermissions.

func (*RBACEndpointPermissionsCollection) Add

func (k *RBACEndpointPermissionsCollection) Add(rbacEndpointPermission RBACEndpointPermission) error

Add adds a rbacEndpointPermission into RBACEndpointPermissionsCollection rbacEndpointPermission.Endpoint should not be nil else an error is thrown.

func (*RBACEndpointPermissionsCollection) Delete

func (k *RBACEndpointPermissionsCollection) Delete(endpointIdentifier string) error

Delete deletes a rbacEndpointPermission by name or ID.

func (*RBACEndpointPermissionsCollection) Get

Get gets a rbacEndpointPermission by name or ID.

func (*RBACEndpointPermissionsCollection) GetAll

GetAll gets a rbacEndpointPermission by name or ID.

func (*RBACEndpointPermissionsCollection) GetAllByRoleID

GetAllByRoleID returns all endpoint permissions by referencing a role by its id.

func (*RBACEndpointPermissionsCollection) Update

func (k *RBACEndpointPermissionsCollection) Update(rbacEndpointPermission RBACEndpointPermission) error

Update updates a rbacEndpointPermission

type RBACRole

type RBACRole struct {
	kong.RBACRole `yaml:",inline"`
	Meta
}

RBACRole represents an RBAC Role in Kong. It adds some helper methods along with Meta to the original RBACRole object.

func (*RBACRole) Console

func (r1 *RBACRole) Console() string

Console returns an entity's identity in a human readable string.

func (*RBACRole) Equal

func (r1 *RBACRole) Equal(r2 *RBACRole) bool

Equal returns true if r1 and r2 are equal. TODO add compare array without position

func (*RBACRole) EqualWithOpts

func (r1 *RBACRole) EqualWithOpts(r2 *RBACRole, ignoreID,
	ignoreTS, _ bool,
) bool

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 (*RBACRole) Identifier

func (r1 *RBACRole) Identifier() string

Identifier returns the endpoint key name or ID.

type RBACRolesCollection

type RBACRolesCollection collection

RBACRolesCollection stores and indexes Kong RBACRoles.

func (*RBACRolesCollection) Add

func (k *RBACRolesCollection) Add(rbacRole RBACRole) error

Add adds a rbacRole into RBACRolesCollection rbacRole.ID should not be nil else an error is thrown.

func (*RBACRolesCollection) Delete

func (k *RBACRolesCollection) Delete(nameOrID string) error

Delete deletes a rbacRole by name or ID.

func (*RBACRolesCollection) Get

func (k *RBACRolesCollection) Get(nameOrID string) (*RBACRole, error)

Get gets a rbacRole by name or ID.

func (*RBACRolesCollection) GetAll

func (k *RBACRolesCollection) GetAll() ([]*RBACRole, error)

GetAll gets a rbacRole by name or ID.

func (*RBACRolesCollection) Update

func (k *RBACRolesCollection) Update(rbacRole RBACRole) error

Update updates a rbacRole

type Route

type Route struct {
	kong.Route `yaml:",inline"`
	Meta
}

Route represents a route in Kong. It adds some helper methods along with Meta to the original Route object.

func (*Route) Console

func (r1 *Route) Console() string

Console returns an entity's identity in a human readable string.

func (*Route) Equal

func (r1 *Route) Equal(r2 *Route) bool

Equal returns true if r1 and r2 are equal. TODO add compare array without position

func (*Route) EqualWithOpts

func (r1 *Route) EqualWithOpts(r2 *Route, ignoreID,
	ignoreTS, ignoreForeign bool,
) bool

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

func (r1 *Route) Identifier() string

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

type SNI struct {
	kong.SNI `yaml:",inline"`
	Meta
}

SNI represents a SNI in Kong. It adds some helper methods along with Meta to the original SNI object.

func (*SNI) Console

func (s1 *SNI) Console() string

Console returns an entity's identity in a human readable string.

func (*SNI) Equal

func (s1 *SNI) Equal(s2 *SNI) bool

Equal returns true if s1 and s2 are equal. TODO add compare array without position

func (*SNI) EqualWithOpts

func (s1 *SNI) EqualWithOpts(s2 *SNI, ignoreID,
	ignoreTS, ignoreForeign bool,
) bool

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

func (s1 *SNI) Identifier() string

Identifier returns the endpoint key name or ID.

type SNIsCollection

type SNIsCollection collection

SNIsCollection stores and indexes Kong SNIs.

func (*SNIsCollection) Add

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

func (k *SNIsCollection) Delete(nameOrID string) error

Delete deletes a sni by name or ID.

func (*SNIsCollection) Get

func (k *SNIsCollection) Get(nameOrID string) (*SNI, error)

Get gets a sni by name or ID.

func (*SNIsCollection) GetAll

func (k *SNIsCollection) GetAll() ([]*SNI, error)

GetAll gets a sni by name or ID.

func (*SNIsCollection) GetAllByCertID

func (k *SNIsCollection) GetAllByCertID(id string) ([]*SNI,
	error,
)

GetAllByCertID returns all routes referencing a service by its id.

func (*SNIsCollection) Update

func (k *SNIsCollection) Update(sni SNI) error

Update updates a sni

type Service

type Service struct {
	kong.Service `yaml:",inline"`
	Meta
}

Service represents a service in Kong. It adds some helper methods along with Meta to the original Service object.

func (*Service) Console

func (s1 *Service) Console() string

Console returns an entity's identity in a human readable string.

func (*Service) Equal

func (s1 *Service) Equal(s2 *Service) bool

Equal returns true if s1 and s2 are equal.

func (*Service) EqualWithOpts

func (s1 *Service) EqualWithOpts(s2 *Service,
	ignoreID bool, ignoreTS bool,
) bool

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

func (s1 *Service) Identifier() string

Identifier returns the endpoint key name or ID.

type ServicePackage

type ServicePackage struct {
	konnect.ServicePackage `yaml:",inline"`
	Meta
}

ServicePackage represents a service package in Konnect. It adds some helper methods along with Meta to the original ServicePackage object.

func (*ServicePackage) Console

func (s1 *ServicePackage) Console() string

Console returns an entity's identity in a human readable string.

func (*ServicePackage) Equal

func (s1 *ServicePackage) Equal(s2 *ServicePackage) bool

Equal returns true if s1 and s2 are equal.

func (*ServicePackage) EqualWithOpts

func (s1 *ServicePackage) EqualWithOpts(s2 *ServicePackage,
	ignoreID bool, _ bool,
) bool

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 (*ServicePackage) Identifier

func (s1 *ServicePackage) Identifier() string

Identifier returns the endpoint key name or ID.

type ServicePackagesCollection

type ServicePackagesCollection collection

ServicePackagesCollection stores and indexes Kong Services.

func (*ServicePackagesCollection) Add

func (k *ServicePackagesCollection) Add(servicePackage ServicePackage) error

Add adds a servicePackage to the collection. service.ID should not be nil else an error is thrown.

func (*ServicePackagesCollection) Delete

func (k *ServicePackagesCollection) Delete(nameOrID string) error

Delete deletes a servicePackage by name or ID.

func (*ServicePackagesCollection) Get

Get gets a servicePackage by name or ID.

func (*ServicePackagesCollection) GetAll

GetAll returns all the servicePackages.

func (*ServicePackagesCollection) Update

func (k *ServicePackagesCollection) Update(servicePackage ServicePackage) error

Update udpates an existing service. It returns an error if the servicePackage is not already present.

type ServiceVersion

type ServiceVersion struct {
	konnect.ServiceVersion `yaml:",inline"`
	Meta
}

ServiceVersion represents a service version in Konnect. It adds some helper methods along with Meta to the original ServiceVersion object.

func (*ServiceVersion) Console

func (s1 *ServiceVersion) Console() string

Console returns an entity's identity in a human readable string.

func (*ServiceVersion) Equal

func (s1 *ServiceVersion) Equal(s2 *ServiceVersion) bool

Equal returns true if s1 and s2 are equal.

func (*ServiceVersion) EqualWithOpts

func (s1 *ServiceVersion) EqualWithOpts(s2 *ServiceVersion,
	ignoreID, _, ignoreForeign bool,
) bool

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 (*ServiceVersion) Identifier

func (s1 *ServiceVersion) Identifier() string

Identifier returns the endpoint key name or ID.

type ServiceVersionsCollection

type ServiceVersionsCollection collection

ServiceVersionsCollection stores and indexes Service Versions.

func (*ServiceVersionsCollection) Add

func (k *ServiceVersionsCollection) Add(serviceVersion ServiceVersion) error

Add adds a serviceVersion into ServiceVersionsCollection serviceVersion.ID should not be nil else an error is thrown.

func (*ServiceVersionsCollection) Delete

func (k *ServiceVersionsCollection) Delete(packageID, nameOrID string) error

Delete deletes a serviceVersion by name or ID.

func (*ServiceVersionsCollection) Get

func (k *ServiceVersionsCollection) Get(packageID, nameOrID string) (*ServiceVersion, error)

Get gets a Service Version by name or ID.

func (*ServiceVersionsCollection) GetAll

GetAll gets all serviceVersios.

func (*ServiceVersionsCollection) GetAllByServicePackageID

func (k *ServiceVersionsCollection) GetAllByServicePackageID(id string) ([]*ServiceVersion,
	error,
)

GetAllByServicePackageID returns all serviceVersions for a servicePackage id.

func (*ServiceVersionsCollection) Update

func (k *ServiceVersionsCollection) Update(serviceVersion ServiceVersion) error

Update updates a Service Version.

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

type Target struct {
	kong.Target `yaml:",inline"`
	Meta
}

Target represents a Target in Kong. It adds some helper methods along with Meta to the original Target object.

func (*Target) Console

func (t1 *Target) Console() string

Console returns an entity's identity in a human readable string.

func (*Target) Equal

func (t1 *Target) Equal(t2 *Target) bool

Equal returns true if t1 and t2 are equal. TODO add compare array without position

func (*Target) EqualWithOpts

func (t1 *Target) EqualWithOpts(t2 *Target, ignoreID,
	ignoreTS, ignoreForeign bool,
) bool

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

func (t1 *Target) Identifier() string

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

type Upstream struct {
	kong.Upstream `yaml:",inline"`
	Meta
}

Upstream represents a upstream in Kong. It adds some helper methods along with Meta to the original Upstream object.

func (*Upstream) Console

func (u1 *Upstream) Console() string

Console returns an entity's identity in a human readable string.

func (*Upstream) Equal

func (u1 *Upstream) Equal(u2 *Upstream) bool

Equal returns true if u1 and u2 are equal.

func (*Upstream) EqualWithOpts

func (u1 *Upstream) EqualWithOpts(u2 *Upstream,
	ignoreID bool, ignoreTS bool,
) bool

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

func (u1 *Upstream) Identifier() string

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.

type Vault

type Vault struct {
	kong.Vault `yaml:",inline"`
	Meta
}

Vault represents a vault in Kong. It adds some helper methods along with Meta to the original Vault object.

func (*Vault) Console

func (v1 *Vault) Console() string

Console returns an entity's identity in a human readable string.

func (*Vault) Equal

func (v1 *Vault) Equal(v2 *Vault) bool

Equal returns true if v1 and v2 are equal. TODO add compare array without position

func (*Vault) EqualWithOpts

func (v1 *Vault) EqualWithOpts(v2 *Vault, ignoreID, ignoreTS bool) bool

EqualWithOpts returns true if v1 and v2 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 (*Vault) Identifier

func (v1 *Vault) Identifier() string

Identifier returns the endpoint key name or ID.

type VaultsCollection

type VaultsCollection collection

VaultsCollection stores and indexes Kong Vaults.

func (*VaultsCollection) Add

func (k *VaultsCollection) Add(vault Vault) error

Add adds a vault to the collection. vault.ID should not be nil else an error is thrown.

func (*VaultsCollection) Delete

func (k *VaultsCollection) Delete(prefixOrID string) error

Delete deletes a vault by its prefix or ID.

func (*VaultsCollection) Get

func (k *VaultsCollection) Get(prefixOrID string) (*Vault, error)

Get gets a vault by prefix or ID.

func (*VaultsCollection) GetAll

func (k *VaultsCollection) GetAll() ([]*Vault, error)

GetAll gets all vaults in the state.

func (*VaultsCollection) Update

func (k *VaultsCollection) Update(vault Vault) error

Update udpates an existing vault.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL