Documentation
¶
Index ¶
- func CleanAddress(address string) string
- func CleanKongVersion(version string) (string, error)
- func Empty(s *string) bool
- func GetKongClient(opt KongClientConfig) (*kong.Client, error)
- func MergeTags(obj interface{}, tags []string) error
- func MustMergeTags(obj interface{}, tags []string)
- func MustRemoveTags(obj interface{}, tags []string)
- func RemoveTags(obj interface{}, tags []string) error
- func UUID() string
- type Defaulter
- type ErrArray
- type HeaderRoundTripper
- type KongClientConfig
- type KongRawState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanAddress ¶
CleanAddress removes trailling / from a URL.
func CleanKongVersion ¶
CleanKongVersion takes a version of Kong and returns back a string in the form of `/major.minor` version. There are various dashes and dots and other descriptors in Kong version strings, which has often created confusion in code and incorrect parsing, and hence this function does not return the patch version (on which shouldn't rely on anyways).
func GetKongClient ¶
func GetKongClient(opt KongClientConfig) (*kong.Client, error)
GetKongClient returns a Kong client
func MustMergeTags ¶
func MustMergeTags(obj interface{}, tags []string)
MustMergeTags is same as MergeTags but panics if there is an error.
func MustRemoveTags ¶
func MustRemoveTags(obj interface{}, tags []string)
MustRemoveTags is same as RemoveTags but panics if there is an error.
func RemoveTags ¶
RemoveTags removes tags from the Tags in obj.
Types ¶
type Defaulter ¶
type Defaulter struct {
// contains filtered or unexported fields
}
Defaulter registers types and fills in struct fields with default values.
func GetKongDefaulter ¶
GetKongDefaulter returns a defaulter which can set default values for Kong entities.
func (*Defaulter) MustSet ¶
func (d *Defaulter) MustSet(arg interface{})
MustSet is like Set but panics if there is an error.
type HeaderRoundTripper ¶
type HeaderRoundTripper struct {
// contains filtered or unexported fields
}
HeaderRoundTripper injects Headers into requests made via RT.
type KongClientConfig ¶
type KongClientConfig struct {
Address string
Workspace string
TLSServerName string
TLSCACert string
TLSSkipVerify bool
Debug bool
SkipWorkspaceCrud bool
Headers []string
}
KongClientConfig holds config details to use to talk to a Kong server.
func (*KongClientConfig) ForWorkspace ¶ added in v1.2.3
func (kc *KongClientConfig) ForWorkspace(name string) KongClientConfig
ForWorkspace returns a copy of KongClientConfig that produces a KongClient for the workspace specified by argument.
type KongRawState ¶
type KongRawState struct {
Services []*kong.Service
Routes []*kong.Route
Plugins []*kong.Plugin
Upstreams []*kong.Upstream
Targets []*kong.Target
Certificates []*kong.Certificate
SNIs []*kong.SNI
CACertificates []*kong.CACertificate
Consumers []*kong.Consumer
CustomEntities []*custom.Entity
KeyAuths []*kong.KeyAuth
HMACAuths []*kong.HMACAuth
JWTAuths []*kong.JWTAuth
BasicAuths []*kong.BasicAuth
ACLGroups []*kong.ACLGroup
Oauth2Creds []*kong.Oauth2Credential
MTLSAuths []*kong.MTLSAuth
}
KongRawState contains all of Kong Data