Documentation ¶
Index ¶
- Constants
- func BaseURL() string
- func CreateConsumerGroup(ctx context.Context, client *kong.Client, entity interface{}) (*kong.ConsumerGroup, error)
- func CreateConsumerGroupMember(ctx context.Context, client *kong.Client, cgID, consumer *string) error
- func CreateRateLimitingAdvancedPlugin(ctx context.Context, client *kong.Client, cgID *string, ...) (*kong.ConsumerGroupRLA, error)
- func DeleteConsumerGroup(ctx context.Context, client *kong.Client, cgID *string) error
- func DeleteConsumerGroupMember(ctx context.Context, client *kong.Client, cgID, consumer *string) error
- func DeleteRateLimitingAdvancedPlugin(ctx context.Context, client *kong.Client, cgID *string) error
- func GetConsumerGroup(ctx context.Context, client *kong.Client, nameOrID *string) (*kong.ConsumerGroup, error)
- func GetConsumerGroupObject(ctx context.Context, client *kong.Client, cgID *string) (*kong.ConsumerGroupObject, error)
- func GetConsumerGroupRateLimitingAdvancedPlugin(ctx context.Context, client *kong.Client, cgID *string) (*kong.ConsumerGroupPlugin, error)
- func IsNotFoundErr(e error) bool
- func IsUnauthorizedErr(e error) bool
- func ListAllConsumerGroupMembers(ctx context.Context, client *kong.Client, cgID *string) ([]*kong.Consumer, error)
- func ListAllConsumerGroups(ctx context.Context, client *kong.Client, tags []*string) ([]*kong.ConsumerGroup, error)
- func UpdateConsumerGroup(ctx context.Context, client *kong.Client, cgID *string, entity interface{}) (*kong.ConsumerGroup, error)
- func UpdateConsumerGroupMember(ctx context.Context, client *kong.Client, cgID, consumer *string) error
- func UpdateRateLimitingAdvancedPlugin(ctx context.Context, client *kong.Client, cgID *string, ...) (*kong.ConsumerGroupRLA, error)
- type APIError
- type AuthResponse
- type AuthService
- type Client
- func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*http.Response, error)
- func (c *Client) NewRequest(method, endpoint string, qs interface{}, body interface{}) (*http.Request, error)
- func (c *Client) SetControlPlaneID(cpID string)
- func (c *Client) SetDebugMode(enableDebug bool)
- func (c *Client) SetLogger(w io.Writer)
- func (c *Client) SetRuntimeGroupID(rgID string)
- type ClientOpts
- type ControlPlane
- type ControlPlaneRelationsService
- func (s *ControlPlaneRelationsService) Create(ctx context.Context, relation *ControlPlaneServiceRelationCreateRequest) (*ControlPlaneServiceRelation, error)
- func (s *ControlPlaneRelationsService) Delete(ctx context.Context, relationID *string) error
- func (s *ControlPlaneRelationsService) List(ctx context.Context, opt *ListOpt) ([]*ControlPlaneServiceRelation, *ListOpt, error)
- func (s *ControlPlaneRelationsService) ListAll(ctx context.Context) ([]*ControlPlaneServiceRelation, error)
- func (s ControlPlaneRelationsService) Update(ctx context.Context, relation *ControlPlaneServiceRelationUpdateRequest) (*ServiceVersion, error)
- type ControlPlaneService
- type ControlPlaneServiceRelation
- type ControlPlaneServiceRelationCreateRequest
- type ControlPlaneServiceRelationUpdateRequest
- type ControlPlaneType
- type Document
- type DocumentService
- func (d *DocumentService) Create(ctx context.Context, doc *Document) (*Document, error)
- func (d *DocumentService) Delete(ctx context.Context, doc *Document) error
- func (d *DocumentService) ListAllForParent(ctx context.Context, parent ParentInfoer) ([]*Document, error)
- func (d *DocumentService) Update(ctx context.Context, doc *Document) (*Document, error)
- type KonnectListOpt
- type ListOpt
- type OrgUserInfo
- type PageOpt
- type ParentInfoer
- type RLAOverride
- type RuntimeGroup
- type RuntimeGroupService
- type ServicePackage
- type ServicePackageService
- func (s *ServicePackageService) Create(ctx context.Context, sp *ServicePackage) (*ServicePackage, error)
- func (s *ServicePackageService) Delete(ctx context.Context, id *string) error
- func (s *ServicePackageService) List(ctx context.Context, opt *ListOpt) ([]*ServicePackage, *ListOpt, error)
- func (s *ServicePackageService) ListAll(ctx context.Context) ([]*ServicePackage, error)
- func (s *ServicePackageService) Update(ctx context.Context, sp *ServicePackage) (*ServicePackage, error)
- type ServiceVersion
- type ServiceVersionService
- func (s *ServiceVersionService) Create(ctx context.Context, sv *ServiceVersion) (*ServiceVersion, error)
- func (s *ServiceVersionService) Delete(ctx context.Context, id *string) error
- func (s *ServiceVersionService) ListForPackage(ctx context.Context, servicePackageID *string) ([]ServiceVersion, error)
- func (s *ServiceVersionService) Update(ctx context.Context, sv *ServiceVersion) (*ServiceVersion, error)
Constants ¶
const (
// KonnectManagedPluginTag is used by Konnect to tag internally-managed plugins
KonnectManagedPluginTag = "konnect-managed-plugin"
)
Variables ¶
This section is empty.
Functions ¶
func CreateConsumerGroup ¶ added in v1.17.0
func CreateConsumerGroupMember ¶ added in v1.17.0
func CreateRateLimitingAdvancedPlugin ¶ added in v1.17.0
func CreateRateLimitingAdvancedPlugin( ctx context.Context, client *kong.Client, cgID *string, config kong.Configuration, ) (*kong.ConsumerGroupRLA, error)
func DeleteConsumerGroup ¶ added in v1.17.0
DeleteConsumerGroup deletes a ConsumerGroup in Kong
func DeleteConsumerGroupMember ¶ added in v1.17.0
func DeleteRateLimitingAdvancedPlugin ¶ added in v1.17.0
func DeleteRateLimitingAdvancedPlugin( ctx context.Context, client *kong.Client, cgID *string, ) error
DeleteRateLimitingAdvancedPlugin deletes a ConsumerGroup plugin in Kong
func GetConsumerGroup ¶ added in v1.17.0
func GetConsumerGroup(ctx context.Context, client *kong.Client, nameOrID *string, ) (*kong.ConsumerGroup, error)
GetConsumerGroup fetches a ConsumerGroup from Konnect.
func GetConsumerGroupObject ¶ added in v1.17.0
func GetConsumerGroupObject(ctx context.Context, client *kong.Client, cgID *string, ) (*kong.ConsumerGroupObject, error)
GetConsumerGroupObject Get fetches a ConsumerGroup from Kong.
func GetConsumerGroupRateLimitingAdvancedPlugin ¶ added in v1.17.0
func GetConsumerGroupRateLimitingAdvancedPlugin( ctx context.Context, client *kong.Client, cgID *string, ) (*kong.ConsumerGroupPlugin, error)
GetConsumerGroupRateLimitingAdvancedPlugin fetches the RLA override for a ConsumerGroup from Konnect.
func IsNotFoundErr ¶
IsNotFoundErr returns true if the error or it's cause is a 404 response from Kong.
func IsUnauthorizedErr ¶ added in v1.12.0
IsUnauthorizedErr returns true if the error or it's cause is a 401 response from Konnect.
func ListAllConsumerGroupMembers ¶ added in v1.17.0
func ListAllConsumerGroupMembers( ctx context.Context, client *kong.Client, cgID *string, ) ([]*kong.Consumer, error)
ListAllConsumerGroupMembers fetches all ConsumerGroups members from Konnect.
func ListAllConsumerGroups ¶ added in v1.17.0
func ListAllConsumerGroups(ctx context.Context, client *kong.Client, tags []*string) ([]*kong.ConsumerGroup, error)
ListAll fetches all ConsumerGroup in Kong.
func UpdateConsumerGroup ¶ added in v1.17.2
func UpdateConsumerGroupMember ¶ added in v1.17.2
func UpdateRateLimitingAdvancedPlugin ¶ added in v1.17.0
func UpdateRateLimitingAdvancedPlugin( ctx context.Context, client *kong.Client, cgID *string, config kong.Configuration, ) (*kong.ConsumerGroupRLA, error)
Types ¶
type APIError ¶
type APIError struct {
// contains filtered or unexported fields
}
APIError is used for Kong Admin API errors.
type AuthResponse ¶
type AuthResponse struct { Name string `json:"name"` OrganizationID string `json:"org_id"` // deprecated fields Organization string `json:"org_name"` FirstName string `json:"first_name"` LastName string `json:"last_name"` FullName string `json:"full_name"` }
AuthResponse is authentication response wrapper for login.
type AuthService ¶
type AuthService service
func (*AuthService) Login ¶
func (s *AuthService) Login(ctx context.Context, email, password string, ) (AuthResponse, error)
func (*AuthService) LoginV2 ¶ added in v1.12.0
func (s *AuthService) LoginV2(ctx context.Context, email, password, token string, ) (AuthResponse, error)
func (*AuthService) OrgUserInfo ¶ added in v1.18.0
func (s *AuthService) OrgUserInfo(ctx context.Context) (*OrgUserInfo, error)
type Client ¶
type Client struct { Auth *AuthService ServicePackages *ServicePackageService ServiceVersions *ServiceVersionService Documents *DocumentService ControlPlanes *ControlPlaneService ControlPlaneRelations *ControlPlaneRelationsService RuntimeGroups *RuntimeGroupService // contains filtered or unexported fields }
Client talks to the Konnect API.
func NewClient ¶
func NewClient(httpClient *http.Client, opts ClientOpts) (*Client, error)
NewClient returns a Client which talks to Konnect's API.
func (*Client) NewRequest ¶
func (c *Client) NewRequest(method, endpoint string, qs interface{}, body interface{}, ) (*http.Request, error)
NewRequest creates a request based on the inputs. endpoint should be relative to the baseURL specified during client creation. body is always marshaled into JSON.
func (*Client) SetControlPlaneID ¶
SetControlPlaneID sets the kong control-plane ID in the client. This is used to inject the control-plane ID in requests as needed.
func (*Client) SetDebugMode ¶
SetDebugMode enables or disables logging of the request to the logger set by SetLogger(). By default, debug logging is disabled.
func (*Client) SetRuntimeGroupID ¶ added in v1.12.0
SetControlPlaneID sets the konnect runtime-group ID in the client.
type ClientOpts ¶ added in v1.7.0
type ClientOpts struct {
BaseURL string
}
ClientOpts contains configuration options for a new Client.
type ControlPlane ¶
type ControlPlane struct { ID *string `json:"id"` Type *ControlPlaneType `json:"type"` }
ControlPlane identifies a specific control plane in Konnect. +k8s:deepcopy-gen=true
func (*ControlPlane) DeepCopy ¶
func (in *ControlPlane) DeepCopy() *ControlPlane
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlane.
func (*ControlPlane) DeepCopyInto ¶
func (in *ControlPlane) DeepCopyInto(out *ControlPlane)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ControlPlaneRelationsService ¶
type ControlPlaneRelationsService service
func (*ControlPlaneRelationsService) Create ¶
func (s *ControlPlaneRelationsService) Create( ctx context.Context, relation *ControlPlaneServiceRelationCreateRequest, ) (*ControlPlaneServiceRelation, error)
Create creates a ControlPlaneServiceRelation in Konnect.
func (*ControlPlaneRelationsService) Delete ¶
func (s *ControlPlaneRelationsService) Delete(ctx context.Context, relationID *string, ) error
Delete deletes a ControlPlaneServiceRelation in Konnect.
func (*ControlPlaneRelationsService) List ¶
func (s *ControlPlaneRelationsService) List(ctx context.Context, opt *ListOpt, ) ([]*ControlPlaneServiceRelation, *ListOpt, error)
List fetches a list of control_plane_service_relations.
func (*ControlPlaneRelationsService) ListAll ¶
func (s *ControlPlaneRelationsService) ListAll(ctx context.Context) ([]*ControlPlaneServiceRelation, error, )
ListAll fetches all control_plane_service_relations.
func (ControlPlaneRelationsService) Update ¶
func (s ControlPlaneRelationsService) Update(ctx context.Context, relation *ControlPlaneServiceRelationUpdateRequest, ) (*ServiceVersion, error)
Update updates a ControlPlaneServiceRelation in Konnect.
type ControlPlaneService ¶
type ControlPlaneService service
func (*ControlPlaneService) List ¶
func (s *ControlPlaneService) List(ctx context.Context, opt *ListOpt, ) ([]ControlPlane, *ListOpt, error)
List fetches a list of control planes. No pagination is being performed because the number of control planes is expected to be very small.
type ControlPlaneServiceRelation ¶
type ControlPlaneServiceRelation struct { ID *string `json:"id,omitempty"` ControlPlaneEntityID *string `json:"control_plane_entity_id,omitempty"` ControlPlane *ControlPlane `json:"control_plane,omitempty"` }
ControlPlaneServiceRelation represents relationship between Control plane implementation and a Service version. +k8s:deepcopy-gen=true
func (*ControlPlaneServiceRelation) DeepCopy ¶
func (in *ControlPlaneServiceRelation) DeepCopy() *ControlPlaneServiceRelation
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneServiceRelation.
func (*ControlPlaneServiceRelation) DeepCopyInto ¶
func (in *ControlPlaneServiceRelation) DeepCopyInto(out *ControlPlaneServiceRelation)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ControlPlaneServiceRelationUpdateRequest ¶
type ControlPlaneServiceRelationUpdateRequest struct { ID string ControlPlaneServiceRelationCreateRequest }
type ControlPlaneType ¶
type ControlPlaneType struct {
Name *string `json:"name"`
}
ControlPlaneType represents control plane associated information. +k8s:deepcopy-gen=true
func (*ControlPlaneType) DeepCopy ¶
func (in *ControlPlaneType) DeepCopy() *ControlPlaneType
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneType.
func (*ControlPlaneType) DeepCopyInto ¶
func (in *ControlPlaneType) DeepCopyInto(out *ControlPlaneType)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Document ¶ added in v1.7.0
type Document struct { ID *string `json:"id,omitempty"` Path *string `json:"path,omitempty"` Content *string `json:"content,omitempty"` Published *bool `json:"published,omitempty"` Parent ParentInfoer `json:"-"` }
func (*Document) ShallowCopy ¶ added in v1.7.0
ShallowCopy is a shallowcopy function, copying the receiver, creating a new Document.
func (*Document) ShallowCopyInto ¶ added in v1.7.0
ShallowCopyInto is a shallowcopy function, copying the receiver, writing into out. d must be non-nil.
type DocumentService ¶ added in v1.7.0
type DocumentService service
func (*DocumentService) Delete ¶ added in v1.7.0
func (d *DocumentService) Delete(ctx context.Context, doc *Document) error
Delete deletes a Document in Konnect.
func (*DocumentService) ListAllForParent ¶ added in v1.7.0
func (d *DocumentService) ListAllForParent(ctx context.Context, parent ParentInfoer) ([]*Document, error)
ListAllForParent fetches all Documents in Konnect for a parent entity.
type KonnectListOpt ¶ added in v1.17.0
type KonnectListOpt struct { // Size of the page Page *PageOpt // Tags to use for filtering the list. Tags []*string `url:"tags,omitempty"` }
func ListConsumerGroupMembers ¶ added in v1.17.0
func ListConsumerGroupMembers(ctx context.Context, client *kong.Client, endpoint string, opt *KonnectListOpt, ) ([]*kong.Consumer, *KonnectListOpt, error)
ListConsumerGroupMembers fetches a page members for a ConsumerGroup from Konnect.
func ListConsumerGroups ¶ added in v1.17.0
func ListConsumerGroups(ctx context.Context, client *kong.Client, opt *KonnectListOpt, ) ([]*kong.ConsumerGroup, *KonnectListOpt, error)
List fetches a list of ConsumerGroup in Kong. opt can be used to control pagination.
type ListOpt ¶
type ListOpt struct { // Size of the page Size int `url:"size,omitempty"` // Page number to fetch Page int `url:"page,omitempty"` }
ListOpt aids in paginating through list endpoints.
type OrgUserInfo ¶ added in v1.18.0
type ParentInfoer ¶ added in v1.7.0
type RLAOverride ¶ added in v1.17.0
type RLAOverride struct { ID *string `json:"id,omitempty" yaml:"id,omitempty"` Value kong.Configuration `json:"value,omitempty" yaml:"value,omitempty"` }
type RuntimeGroup ¶ added in v1.12.0
RuntimeGroup represents a Runtime Group in Konnect. +k8s:deepcopy-gen=true
func (*RuntimeGroup) DeepCopy ¶ added in v1.12.0
func (in *RuntimeGroup) DeepCopy() *RuntimeGroup
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuntimeGroup.
func (*RuntimeGroup) DeepCopyInto ¶ added in v1.12.0
func (in *RuntimeGroup) DeepCopyInto(out *RuntimeGroup)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RuntimeGroupService ¶ added in v1.12.0
type RuntimeGroupService service
func (*RuntimeGroupService) List ¶ added in v1.12.0
func (s *RuntimeGroupService) List(ctx context.Context, opt *ListOpt, ) ([]*RuntimeGroup, *ListOpt, error)
List fetches a list of Service packages.
type ServicePackage ¶
type ServicePackage struct { ID *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` Description *string `json:"description"` Versions []ServiceVersion `json:"versions,omitempty"` }
ServicePackage represents a Service Package in Konnect. +k8s:deepcopy-gen=true
func (*ServicePackage) DeepCopy ¶
func (in *ServicePackage) DeepCopy() *ServicePackage
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServicePackage.
func (*ServicePackage) DeepCopyInto ¶
func (in *ServicePackage) DeepCopyInto(out *ServicePackage)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ServicePackage) Key ¶ added in v1.7.0
func (p *ServicePackage) Key() string
func (*ServicePackage) URL ¶ added in v1.7.0
func (p *ServicePackage) URL() string
type ServicePackageService ¶
type ServicePackageService service
func (*ServicePackageService) Create ¶
func (s *ServicePackageService) Create(ctx context.Context, sp *ServicePackage, ) (*ServicePackage, error)
Create creates a ServicePackage in Konnect.
func (*ServicePackageService) Delete ¶
func (s *ServicePackageService) Delete(ctx context.Context, id *string) error
Delete deletes a ServicePackage in Konnect.
func (*ServicePackageService) List ¶
func (s *ServicePackageService) List(ctx context.Context, opt *ListOpt, ) ([]*ServicePackage, *ListOpt, error)
List fetches a list of Service packages.
func (*ServicePackageService) ListAll ¶
func (s *ServicePackageService) ListAll(ctx context.Context) ([]*ServicePackage, error, )
ListAll fetches all Service packages.
func (*ServicePackageService) Update ¶
func (s *ServicePackageService) Update(ctx context.Context, sp *ServicePackage, ) (*ServicePackage, error)
Update updates a ServicePackage in Konnect.
type ServiceVersion ¶
type ServiceVersion struct { ID *string `json:"id,omitempty"` Version *string `json:"version,omitempty"` ServicePackage *ServicePackage `json:"service_package,omitempty"` ControlPlaneServiceRelation *ControlPlaneServiceRelation `json:"control_plane_service_relation,omitempty"` }
ServiceVersion represents a Service Version in Konnect. +k8s:deepcopy-gen=true
func (*ServiceVersion) DeepCopy ¶
func (in *ServiceVersion) DeepCopy() *ServiceVersion
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceVersion.
func (*ServiceVersion) DeepCopyInto ¶
func (in *ServiceVersion) DeepCopyInto(out *ServiceVersion)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ServiceVersion) Key ¶ added in v1.7.0
func (v *ServiceVersion) Key() string
func (*ServiceVersion) URL ¶ added in v1.7.0
func (v *ServiceVersion) URL() string
type ServiceVersionService ¶
type ServiceVersionService service
func (*ServiceVersionService) Create ¶
func (s *ServiceVersionService) Create(ctx context.Context, sv *ServiceVersion, ) (*ServiceVersion, error)
Create creates a ServiceVersion in Konnect.
func (*ServiceVersionService) Delete ¶
func (s *ServiceVersionService) Delete(ctx context.Context, id *string) error
Delete deletes a ServiceVersion in Konnect.
func (*ServiceVersionService) ListForPackage ¶
func (s *ServiceVersionService) ListForPackage(ctx context.Context, servicePackageID *string, ) ([]ServiceVersion, error)
ListForPackage fetches a list of Service Versions for a given servicePackageID.
func (*ServiceVersionService) Update ¶
func (s *ServiceVersionService) Update(ctx context.Context, sv *ServiceVersion, ) (*ServiceVersion, error)
Update updates a ServiceVersion in Konnect.