konnect

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveHealthcheck

type ActiveHealthcheck struct {
	Concurrency            int       `json:"concurrency"`
	Headers                Headers   `json:"headers,omitempty"`
	Healthy                Healthy   `json:"healthy"`
	HttpsVerifyCertificate bool      `json:"https_verify_certificate"`
	HttpPath               string    `json:"http_path,omitempty"`
	HttpsSni               string    `json:"https_sni,omitempty"`
	Timeout                int       `json:"timeout"`
	Type                   string    `json:"type,omitempty"`
	Unhealthy              Unhealthy `json:"unhealthy"`
}

type CertMetadata

type CertMetadata struct {
	DnsNames  []string `json:"dns_names,omitempty"`
	Expiry    string   `json:"expiry"`
	Issuer    string   `json:"issuer"`
	KeyUsages []string `json:"key_usages"`
	SanNames  []string `json:"san_names"`
	Snis      []string `json:"snis"`
	Subject   string   `json:"subject"`
}

type Certificate

type Certificate struct {
	Cert      string       `json:"cert"`
	CreatedAt int64        `json:"created_at"`
	Id        string       `json:"id"`
	Key       string       `json:"key"`
	Metadata  CertMetadata `json:"metadata"`
	Tags      []string     `json:"tags,omitempty"`
	UpdatedAt int64        `json:"updated_at"`
}

type CertificateRef

type CertificateRef struct {
	Id string `json:"id"`
}

type CertificateResponse

type CertificateResponse struct {
	Data   []Certificate `json:"data"`
	Next   string        `json:"next,omitempty"`
	Offset string        `json:"offset,omitempty"`
}

type Client

type Client struct {
	Client          *http.Client
	BaseURL         *url.URL
	UserAgent       string
	Options         *ClientOptions
	ResponseTimeout time.Duration
}

func NewClient

func NewClient(endpoint string, options *ClientOptions) *Client

func (*Client) CertificateGetById

func (c *Client) CertificateGetById(controlPlaneId string, certificateId string) (certificate *Certificate, err error)

func (*Client) CertificatesGet

func (c *Client) CertificatesGet(controlPlaneId string, parameters []string) (certificates []Certificate, err error)

func (*Client) ConsumerGetById

func (c *Client) ConsumerGetById(controlPlaneId string, consumerId string) (consumer *Consumer, err error)

func (*Client) ConsumersGet

func (c *Client) ConsumersGet(controlPlaneId string, parameters []string) (consumers []Consumer, err error)

func (*Client) ControlPlaneGetId

func (c *Client) ControlPlaneGetId(controlPlaneId string) (controlPlane *ControlPlane, err error)

func (*Client) ControlPlanesGet

func (c *Client) ControlPlanesGet(parameters []string) (controlPlanes []ControlPlane, err error)

func (*Client) ControlPlanesGetPage

func (c *Client) ControlPlanesGetPage(pageSize int, pageNumber int, parameters []string) (*ControlPlaneResponse, error)

func (*Client) Do

func (c *Client) Do(req *http.Request, v interface{}) (resp *RestResponse, err error)

func (*Client) DpNodeGetById

func (c *Client) DpNodeGetById(controlPlaneId string, dpNodeId string) (dpNode *DpNode, err error)

func (*Client) DpNodesGet

func (c *Client) DpNodesGet(controlPlaneId string, parameters []string) (nodes []DpNode, err error)

func (*Client) NewRequest

func (c *Client) NewRequest(method string, apiPath string, parameters []string, body interface{}) (req *http.Request, err error)

func (*Client) PluginGetById

func (c *Client) PluginGetById(controlPlaneId string, routeId string, pluginId string) (plugin *Plugin, err error)

func (*Client) PluginsGet

func (c *Client) PluginsGet(controlPlaneId string, routeId string, parameters []string) (plugins []Plugin, err error)

func (*Client) RouteGetById

func (c *Client) RouteGetById(controlPlaneId string, routeId string) (route *Route, err error)

func (*Client) RoutesGet

func (c *Client) RoutesGet(controlPlaneId string, parameters []string) (routes []Route, err error)

func (*Client) ServiceGetById

func (c *Client) ServiceGetById(controlPlaneId string, serviceId string) (service *Service, err error)

func (*Client) ServicesGet

func (c *Client) ServicesGet(controlPlaneId string, parameters []string) (services []Service, err error)

func (*Client) SniGetById

func (c *Client) SniGetById(controlPlaneId string, sniId string) (sni *Sni, err error)

func (*Client) SnisGet

func (c *Client) SnisGet(controlPlaneId string, parameters []string) (snis []Sni, err error)

func (*Client) UpstreamGetById

func (c *Client) UpstreamGetById(controlPlaneId string, upstreamId string) (upstream *Upstream, err error)

func (*Client) UpstreamsGet

func (c *Client) UpstreamsGet(controlPlaneId string, parameters []string) (upstreams []Upstream, err error)

type ClientOptions

type ClientOptions struct {
	Token     string
	SSLVerify bool
	Debug     bool
	Timeout   time.Duration
}

func DefaultOptions

func DefaultOptions() *ClientOptions

type Config

type Config interface{}

type Consumer

type Consumer struct {
	CreatedAt int64    `json:"created_at"`
	CustomId  string   `json:"custom_id"`
	Id        string   `json:"id"`
	Tags      []string `json:"tags,omitempty"`
	UpdatedAt int64    `json:"updated_at"`
	UserName  string   `json:""username"`
}

type ConsumerResponse

type ConsumerResponse struct {
	Data   []Consumer `json:"data"`
	Next   string     `json:"next,omitempty"`
	Offset string     `json:"offset,omitempty"`
}

type ControlPlane

type ControlPlane struct {
	Id          string             `json:"id"`
	Name        string             `json:"name"`
	Description string             `json:"description,omitempty"`
	Labels      map[string]string  `json:"labels,omitempty"`
	Config      ControlPlaneConfig `json:"config"`
	CreatedAt   string             `json:"created_at,omitempty"`
	UpdatedAt   string             `json:"updated_at,omitempty"`
}

type ControlPlaneConfig

type ControlPlaneConfig struct {
	ControlPlaneEndpoint string `json:"control_plane_endpoint,omitempty"`
	TelemetryEndpoint    string `json:"telemetry_endpoint,omitempty"`
	ClusterType          string `json:"cluster_type,omitempty"`
}

type ControlPlaneResponse

type ControlPlaneResponse struct {
	Meta Meta `json:"meta"`
	Data []ControlPlane
}

type DpNode

type DpNode struct {
	CompatibilityStatus struct {
		State string `json:"state"`
	} `json:"compatibility_status"`
	ConfigHash string `json:"config_hash"`
	CreatedAt  int64  `json:"created_at"`
	Hostname   string `json:"hostname"`
	Id         string `json:"id"`
	LastPing   int64  `json:"last_ping"`
	Status     string `json:"status,omitempty"`
	Type       string `json:"type"`
	UpdatedAt  int64  `json:"updated_at"`
	Version    string `json:"version"`
}

type DpNodeResponse

type DpNodeResponse struct {
	Items []DpNode `json:"items"`
	Page  struct {
		TotalCount int `json:"total_count"`
	} `json:"page"`
}

type ErrorResponse

type ErrorResponse struct {
	Status   int    `json:"status,omitempty"`
	Title    string `json:"title,omitempty"`
	Instance string `json:"instance,omitempty"`
	Message  string `json:"message,omitempty"`
	Detail   string `json:"detail,omitempty"`
}

type Headers

type Headers interface{}

type Healthchecks

type Healthchecks struct {
	Active    ActiveHealthcheck  `json:"active"`
	Threshold int                `json:"threshold"`
	Passive   PassiveHealthcheck `json:"passive"`
}

type Healthy

type Healthy struct {
	HttpStatuses []int `json:"http_statuses"`
	Successes    int   `json:"successes"`
	Interval     int   `json:"interval"`
}

type Meta

type Meta struct {
	Page Page `json:"page"`
}

type Page

type Page struct {
	Total  int `json:"total"`
	Size   int `json:"size"`
	Number int `json:"number"`
}

type PassiveHealthcheck

type PassiveHealthcheck struct {
	Healthy   Healthy   `json:"healthy"`
	Type      string    `json:"type,omitempty"`
	Unhealthy Unhealthy `json:"unhealthy"`
}

type Plugin

type Plugin struct {
	Config    Config     `json:"config"`
	CreatedAt int64      `json:"created_at"`
	Id        string     `json:"id"`
	Name      string     `json:"name"`
	Protocols []string   `json:"protocols,omitempty"`
	Route     ServiceRef `json:"service,omitempty"`
	Tags      []string   `json:"tags,omitempty"`
	UpdatedAt int64      `json:"updated_at"`
}

type PluginResponse

type PluginResponse struct {
	Data   []Plugin `json:"data"`
	Next   string   `json:"next,omitempty"`
	Offset string   `json:"offset,omitempty"`
}

type RestResponse

type RestResponse struct {
	ErrorResponse ErrorResponse
	HttpResponse  *http.Response
}

type Route

type Route struct {
	CreatedAt               int64      `json:"created_at"`
	Hosts                   []string   `json:"hosts,omitempty"`
	HttpsRedirectStatusCode int        `json:"https_redirect_status_code"`
	Id                      string     `json:"id"`
	Name                    string     `json:"name"`
	PathHandling            string     `json:"path_handling,omitempty"`
	Paths                   []string   `json:"paths,omitempty"`
	PreserveHost            bool       `json:"preserve_host"`
	Protocols               []string   `json:"protocols,omitempty"`
	RegexPriority           int        `json:"regex_priority"`
	RequestBuffering        bool       `json:"request_buffering"`
	ResponseBuffering       bool       `json:"response_buffering"`
	Service                 ServiceRef `json:"service"`
	StripPath               bool       `json:"strip_path"`
	Tags                    []string   `json:"tags,omitempty"`
	UpdatedAt               int64      `json:"updated_at"`
}

type RouteRef

type RouteRef struct {
	Id string `json:"id"`
}

type RouteResponse

type RouteResponse struct {
	Data   []Route `json:"data"`
	Next   string  `json:"next,omitempty"`
	Offset string  `json:"offset,omitempty"`
}

type Service

type Service struct {
	ConnectTimeout int      `json:"connect_timeout"`
	CreatedAt      int64    `json:"created_at"`
	Enabled        bool     `json:"enabled"`
	Host           string   `json:"host,omitempty"`
	Id             string   `json:"id"`
	Name           string   `json:"name"`
	Path           string   `json:"path,omitempty"`
	Port           int      `json:"port"`
	Protocol       string   `json:"protocol,omitempty"`
	ReadTimeout    int      `json:"read_timeout"`
	Retries        int      `json:"retries"`
	Tags           []string `json:"tags,omitempty"`
	UpdatedAt      int64    `json:"updated_at"`
	WriteTimeout   int      `json:"write_timeout"`
}

type ServiceRef

type ServiceRef struct {
	Id string `json:"id"`
}

type ServiceResponse

type ServiceResponse struct {
	Data   []Service `json:"data"`
	Next   string    `json:"next,omitempty"`
	Offset string    `json:"offset,omitempty"`
}

type Sni

type Sni struct {
	Certificate CertificateRef `json:"certificate"`
	CreatedAt   int64          `json:"created_at"`
	Id          string         `json:"id"`
	Name        string         `json:"name"`
	UpdatedAt   int64          `json:"updated_at"`
}

type SniResponse

type SniResponse struct {
	Data   []Sni  `json:"data"`
	Next   string `json:"next,omitempty"`
	Offset string `json:"offset,omitempty"`
}

type Unhealthy

type Unhealthy struct {
	HttpStatuses []int `json:"http_statuses"`
	HttpFailures int   `json:"http_failures"`
	Timeouts     int   `json:"timeouts"`
	TcpFailures  int   `json:"tcp_failures"`
	Interval     int   `json:"interval"`
}

type Upstream

type Upstream struct {
	Algorithm         string          `json:"created_at"`
	ClientCertificate *CertificateRef `json:"client_certificate,omitempty"`
	CreatedAt         int64           `json:"created_at"`
	HashFallback      string          `json:"hash_fallback"`
	HashOn            string          `json:"hash_on"`
	HashOnCookiePath  string          `json:"hash_on_cookie_path"`
	Healthchecks      Healthchecks    `json:"healthchecks"`
	HostHeader        string          `json:""host_header,omitempty"`
	Id                string          `json:"id"`
	Name              string          `json:"name"`
	Slots             int             `json:"slots"`
	Tags              []string        `json:"tags,omitempty"`
	UseSrvName        bool            `json:"use_srv_name"`
}

type UpstreamResponse

type UpstreamResponse struct {
	Data   []Upstream `json:"data"`
	Next   string     `json:"next,omitempty"`
	Offset string     `json:"offset,omitempty"`
}

Jump to

Keyboard shortcuts

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