Documentation
¶
Index ¶
- Constants
- Variables
- func Kind(kind string) schema.GroupKind
- func Resource(resource string) schema.GroupResource
- type API
- type APIGetter
- type APIInterface
- type APIList
- type APIResponse
- type CoreClient
- type CoreInterface
- type Domain
- func (in *Domain) DeepCopy() *Domain
- func (in *Domain) DeepCopyInto(out *Domain)
- func (in *Domain) DeepCopyObject() runtime.Object
- func (d *Domain) GetDomain() string
- func (d *Domain) GetDomainType() string
- func (d *Domain) GetPrimaryDomain() string
- func (d *Domain) HasKongFinalizer() bool
- func (d *Domain) IsMarkedForDeletion() bool
- func (d *Domain) IsPrimary() bool
- func (c *Domain) IsUpdateExpired(expireAfter time.Duration) bool
- func (d *Domain) IsValidDomain() bool
- func (d *Domain) IsValidSharedDomain() bool
- type DomainList
- type DomainPhase
- type DomainSpec
- type DomainStatus
- type KongVersion
- type Plugin
- type PluginGetter
- type PluginInterface
- type PluginList
- type PluginName
- type PluginSchema
- type Timestamp
Constants ¶
const ( GroupName = "platform.koli.io" ResourceKind = "Domain" ResourcePlural = "domains" )
const (
Finalizer = "kolihub.io/kong"
)
Variables ¶
var ( SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} ResourceName = ResourcePlural + "." + GroupName )
var ( // SchemeBuilder collects functions that add things to a scheme. It's to allow // code to compile without explicitly referencing generated types. You should // declare one in each package that will have generated deep copy or conversion // functions. SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme applies all the stored functions to the scheme. A non-nil error // indicates that one function failed and the attempt was abandoned. AddToScheme = SchemeBuilder.AddToScheme )
Functions ¶
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group qualified GroupResource
Types ¶
type API ¶
type API struct { UID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Hosts []string `json:"hosts,omitempty"` URIs []string `json:"uris,omitempty"` PreserveHost bool `json:"preserve_host"` UpstreamURL string `json:"upstream_url"` CreatedAt Timestamp `json:"created_at,omitempty"` StripUri bool `json:"strip_uri"` }
API represents a kong api object ref: https://getkong.org/docs/0.10.x/admin-api/#api-object
type APIGetter ¶
type APIGetter interface {
API() APIInterface
}
APIGetter has a method to return an ApiInterface A group's client should implement this interface.
type APIInterface ¶
type APIInterface interface { List(params url.Values) (*APIList, error) ListByRegexp(params url.Values, pattern string) (*APIList, error) Get(name string) (*API, *APIResponse) UpdateOrCreate(data *API) (*API, *APIResponse) Delete(nameOrID string) error }
APIInterface has methods to work with Kong Endpoints ref: https://getkong.org/docs/0.9.x/admin-api/#api-object
type APIList ¶
type APIList struct { Total int `json:"total"` Items []API `json:"data"` NextPage string `json:"next"` Offset string `json:"offset"` }
APIList is a list of API's ref: https://getkong.org/docs/0.10.x/admin-api/#list-apis
type APIResponse ¶
APIResponse contains the response from an API call
func (*APIResponse) Error ¶
func (r *APIResponse) Error() error
func (*APIResponse) String ¶
func (r *APIResponse) String() string
type CoreClient ¶
type CoreClient struct {
// contains filtered or unexported fields
}
CoreClient is used to interact with features provided by the Core group.
func NewKongRESTClient ¶
func NewKongRESTClient(c *rest.Config) (*CoreClient, error)
NewKongRESTClient generates a new *rest.Interface to communicate with the Kong Admin API
func (*CoreClient) API ¶
func (c *CoreClient) API() APIInterface
func (*CoreClient) Plugin ¶
func (c *CoreClient) Plugin(apiNameOrID string) PluginInterface
func (*CoreClient) RESTClient ¶
func (c *CoreClient) RESTClient() rest.Interface
RESTClient returns a RESTClient that is used to communicate with API server by this client implementation.
type CoreInterface ¶
type CoreInterface interface { RESTClient() rest.Interface APIGetter PluginGetter }
type Domain ¶
type Domain struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec DomainSpec `json:"spec"` Status DomainStatus `json:"status"` }
func (*Domain) DeepCopyInto ¶
func (*Domain) DeepCopyObject ¶
func (*Domain) GetDomainType ¶
GetDomainType returns the type of the resource: 'primary' or 'shared'
func (*Domain) GetPrimaryDomain ¶
GetPrimaryDomain returns the primary domain of the resource
func (*Domain) HasKongFinalizer ¶
HasKongFinalizer verify if the kong finalizer is set on the resource
func (*Domain) IsMarkedForDeletion ¶
IsMarkedForDeletion validates if the resource is set for deletion
func (*Domain) IsUpdateExpired ¶
IsUpdateExpired validates if the last update of the resource is expired
func (*Domain) IsValidDomain ¶
func (*Domain) IsValidSharedDomain ¶
IsValidSharedDomain verifies if the shared domain it's a subdomain from the primary
type DomainList ¶
type DomainList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []Domain `json:"items"` }
func (*DomainList) DeepCopy ¶
func (in *DomainList) DeepCopy() *DomainList
func (*DomainList) DeepCopyInto ¶
func (in *DomainList) DeepCopyInto(out *DomainList)
func (*DomainList) DeepCopyObject ¶
func (in *DomainList) DeepCopyObject() runtime.Object
type DomainPhase ¶
type DomainPhase string
DomainPhase is a label for the condition of a domain at the current time.
const ( // DomainStatusNew means it's a new resource and the phase it's not set DomainStatusNew DomainPhase = "" // DomainStatusOK means the domain doesn't have no pending operations or prohibitions, // and new ingresses could be created using the target domain. DomainStatusOK DomainPhase = "OK" // DomainStatusPending indicates that a request to create a new domain // has been received and is being processed. DomainStatusPending DomainPhase = "Pending" // DomainStatusFailed means the resource has failed on claiming the domain DomainStatusFailed DomainPhase = "Failed" )
type DomainSpec ¶
type DomainSpec struct { // PrimaryDomain is the name of the primary domain, to set the resource as primary, // 'name' and 'primary' must have the same value. // +required PrimaryDomain string `json:"primary"` // Sub is the label of the Primary Domain to form a subdomain // +optional Sub string `json:"sub,omitempty"` // Delegates contains a list of namespaces that are allowed to use this domain. // New domain resources could be referenced to primary ones using the 'parent' key. // A wildcard ("*") allows delegate access to all namespaces in the cluster. // +optional Delegates []string `json:"delegates,omitempty"` // Parent refers to the namespace where the primary domain is in. // It only makes sense when the type of the domain is set to 'shared', // +optional Parent string `json:"parent,omitempty"` }
DomainSpec represents information about a domain claim
func (*DomainSpec) DeepCopy ¶
func (in *DomainSpec) DeepCopy() *DomainSpec
func (*DomainSpec) DeepCopyInto ¶
func (in *DomainSpec) DeepCopyInto(out *DomainSpec)
type DomainStatus ¶
type DomainStatus struct { // The state of the domain, an empty state means it's a new resource // +optional Phase DomainPhase `json:"phase,omitempty"` // A human readable message indicating details about why the domain claim is in this state. // +optional Message string `json:"message,omitempty"` // A brief CamelCase message indicating details about why the domain claim is in this state. e.g. 'AlreadyClaimed' // +optional Reason string `json:"reason,omitempty"` // The last time the resource was updated LastUpdateTime time.Time `json:"lastUpdateTime,omitempty"` // DeletionTimestamp it's a temporary field to work around the issue: // https://github.com/kubernetes/kubernetes/issues/40715, once it's solved, // remove this field and use the DeletionTimestamp from metav1.ObjectMeta DeletionTimestamp *metav1.Time `json:"deletionTimestamp,omitempty"` }
DomainStatus represents information about the status of a domain.
func (*DomainStatus) DeepCopy ¶
func (in *DomainStatus) DeepCopy() *DomainStatus
func (*DomainStatus) DeepCopyInto ¶
func (in *DomainStatus) DeepCopyInto(out *DomainStatus)
type KongVersion ¶
KongVersion represents the semantic version of a kong node
func (*KongVersion) String ¶
func (k *KongVersion) String() string
String returns the string representation of the KongVersion struct
type Plugin ¶
type Plugin struct { UID string `json:"id,omitempty"` APIUID string `json:"api_id,omitempty"` Name PluginName `json:"name"` ConsumerID string `json:"consumer_id,omitempty"` Config PluginSchema `json:"config"` Enabled bool `json:"enabled,omitempty"` CreatedAt Timestamp `json:"created_at,omitempty"` }
Plugin represents a kong plugin object ref: https://getkong.org/docs/0.10.x/admin-api/#plugin-object
type PluginGetter ¶
type PluginGetter interface {
Plugin() PluginInterface
}
PluginGetter has a method to return an PluginInterface A group's client should implement this interface.
type PluginInterface ¶
type PluginInterface interface { List(selector fields.Selector) (*PluginList, error) Get(pluginID string) (*Plugin, error) UpdateOrCreate(data *Plugin) (*Plugin, error) Delete(pluginID string) error }
PluginInterface has methods to work with Kong Endpoints ref: https://getkong.org/docs/0.9.x/admin-api/#api-object
type PluginList ¶
type PluginList struct { Total int `json:"total"` Items []Plugin `json:"data"` NextPage string `json:"next"` }
PluginList is a list of plugins ref: https://getkong.org/docs/0.10.x/admin-api/#list-all-plugins
type PluginName ¶
type PluginName string
PluginName is an installed plugin on kong ref: https://getkong.org/plugins/
const ( // ref: https://getkong.org/plugins/cors/ CorsPlugin PluginName = "cors" // ref: https://getkong.org/plugins/ip-restriction/ IpRestrictionPlugin PluginName = "ip-restriction" // ref: https://getkong.org/plugins/dynamic-ssl/ DynamicSSLPlugin PluginName = "ssl" // ref: https://getkong.org/plugins/rate-limiting/ RateLimitingPlugin PluginName = "rate-limiting" )
https://getkong.org/docs/0.10.x/admin-api/#retrieve-enabled-plugins
type PluginSchema ¶
type PluginSchema map[string]interface{}
PluginSchema holds the specification of a plugin