resource

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeNode = model.Type("node")

	NodeTypeKongProxy = "kong-proxy"
)
View Source
const (
	TypePlugin = model.Type("plugin")

	// OrderingRuleTitle denotes the title of the ordering-related rule.
	OrderingRuleTitle = "ordering"
)
View Source
const (
	// TypeRoute denotes the Route type.
	TypeRoute model.Type = "route"

	// RouteSNIRuleTitle denotes the name of the schema rule to apply
	// when using SNIs.
	RouteSNIRuleTitle = "sni_rule"
	// WSProtocolsRuleTitle denotes the name of the schema rule to apply
	// to ws protocols.
	WSProtocolsRuleTitle = "ws_protocols_rule"
)
View Source
const (

	// TypeService denotes the Service type.
	TypeService = model.Type("service")

	// ClientCertificateRuleTitle denotes the name of the schema rule to apply
	// when using client_certificates.
	ClientCertificateRuleTitle = "client_certificate_rule"
	// TLSVerifyRuleTitle denotes the name of the schema rule to apply
	// when using tls_verify.
	TLSVerifyRuleTitle = "tls_verify_rule"
)
View Source
const (
	ID = "installation_id"
)
View Source
const (
	TypeCACertificate model.Type = "ca_certificate"
)
View Source
const (
	TypeCertificate model.Type = "certificate"
)
View Source
const (
	TypeConsumer = model.Type("consumer")
)
View Source
const (
	TypeNodeStatus = model.Type("node-status")
)
View Source
const (
	// TypePluginSchema denotes the Plugin Schema type.
	TypePluginSchema = model.Type("plugin_schema")
)
View Source
const (
	TypeSNI model.Type = "sni"
)
View Source
const (
	// TypeTarget denotes the Target type.
	TypeTarget model.Type = "target"
)
View Source
const (
	TypeUpstream model.Type = "upstream"
)

Variables

View Source
var (
	IPv4LikePattern       = regexp.MustCompile(`^[0-9.]+(/\d+)?$`)
	HostnamePattern       = regexp.MustCompile(typedefs.HostnamePattern)
	IPv6HasPortPattern    = regexp.MustCompile(`\]\:\d+$`)
	IPv6HasBracketPattern = regexp.MustCompile(`\[\S+\]$`)
)
View Source
var PluginName = &generator.Schema{
	Type:      "string",
	Pattern:   `^[0-9a-zA-Z\-]*$`,
	MinLength: 1,
	MaxLength: maxPluginNameLength,
}
View Source
var TypeHash = model.Type("hash")
View Source
var TypeInstallation = model.Type("installation")

Functions

func NewList

func NewList(typ model.Type) model.ObjectList

func SetValidator

func SetValidator(v plugin.Validator)

Types

type CACertificate

type CACertificate struct {
	CACertificate *v1.CACertificate
}

func NewCACertificate

func NewCACertificate() CACertificate

func (CACertificate) ID

func (r CACertificate) ID() string

func (CACertificate) Indexes

func (r CACertificate) Indexes() []model.Index

func (CACertificate) ProcessDefaults

func (r CACertificate) ProcessDefaults(ctx context.Context) error

func (CACertificate) Resource

func (r CACertificate) Resource() model.Resource

func (CACertificate) SetResource

func (r CACertificate) SetResource(pr model.Resource) error

SetResource implements the Object.SetResource interface.

func (CACertificate) Type

func (r CACertificate) Type() model.Type

func (CACertificate) Validate

func (r CACertificate) Validate(ctx context.Context) error

type Certificate

type Certificate struct {
	Certificate *v1.Certificate
}

func NewCertificate

func NewCertificate() Certificate

func (Certificate) ID

func (r Certificate) ID() string

func (Certificate) Indexes

func (r Certificate) Indexes() []model.Index

func (Certificate) ProcessDefaults

func (r Certificate) ProcessDefaults(ctx context.Context) error

func (Certificate) Resource

func (r Certificate) Resource() model.Resource

func (Certificate) SetResource

func (r Certificate) SetResource(pr model.Resource) error

SetResource implements the Object.SetResource interface.

func (Certificate) Type

func (r Certificate) Type() model.Type

func (Certificate) Validate

func (r Certificate) Validate(ctx context.Context) error

type Consumer

type Consumer struct {
	Consumer *v1.Consumer
}

func NewConsumer

func NewConsumer() Consumer

func (Consumer) ID

func (c Consumer) ID() string

func (Consumer) Indexes

func (c Consumer) Indexes() []model.Index

func (Consumer) ProcessDefaults

func (c Consumer) ProcessDefaults(ctx context.Context) error

func (Consumer) Resource

func (c Consumer) Resource() model.Resource

func (Consumer) SetResource

func (c Consumer) SetResource(r model.Resource) error

SetResource implements the Object.SetResource interface.

func (Consumer) Type

func (c Consumer) Type() model.Type

func (Consumer) Validate

func (c Consumer) Validate(ctx context.Context) error

type Hash

type Hash struct {
	Hash *v1.ConfigHash
}

func NewHash

func NewHash() Hash

func (Hash) ID

func (r Hash) ID() string

func (Hash) Indexes

func (r Hash) Indexes() []model.Index

func (Hash) ProcessDefaults

func (r Hash) ProcessDefaults(ctx context.Context) error

func (Hash) Resource

func (r Hash) Resource() model.Resource

func (Hash) SetResource

func (r Hash) SetResource(pr model.Resource) error

SetResource implements the Object.SetResource interface.

func (Hash) Type

func (r Hash) Type() model.Type

func (Hash) Validate

func (r Hash) Validate(ctx context.Context) error

type Installation

type Installation struct {
	Installation *v1.Installation
}

Installation represents an installation of koko.

func NewInstallation

func NewInstallation() Installation

NewInstallation returns a new Installation resource with the default Id value. The installationID is generated once in the lifetime of a koko cluster and must be unique. This unique value is generated at runtime and stored in Installation.Value.

func (Installation) ID

func (r Installation) ID() string

ID returns the resource ID. This is always "installation_id" for resources of type Installation to avoid a race condition encountered when using a dynamic value for the ID.

func (Installation) Indexes

func (r Installation) Indexes() []model.Index

func (Installation) ProcessDefaults

func (r Installation) ProcessDefaults(ctx context.Context) error

ProcessDefaults sets the default values for the resource. This is a no-op for Installation.

func (Installation) Resource

func (r Installation) Resource() model.Resource

Resource returns the underlying Installation resource.

func (Installation) SetResource

func (r Installation) SetResource(ir model.Resource) error

SetResource implements the Object.SetResource interface.

func (Installation) Type

func (r Installation) Type() model.Type

Type returns the type of this resource.

func (Installation) Validate

func (r Installation) Validate(ctx context.Context) error

Validate wraps validation.Validate, which assesses the validity of the generated schema.

type List

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

func (*List) Add

func (l *List) Add(object model.Object)

func (*List) GetAll

func (l *List) GetAll() []model.Object

func (*List) GetNextPage

func (l *List) GetNextPage() int

func (*List) GetTotalCount

func (l *List) GetTotalCount() int

func (*List) SetNextPage

func (l *List) SetNextPage(pageNum int)

func (*List) SetTotalCount

func (l *List) SetTotalCount(count int)

func (*List) Type

func (l *List) Type() model.Type

type Node

type Node struct {
	Node *v1.Node
}

func NewNode

func NewNode() Node

func (Node) ID

func (r Node) ID() string

func (Node) Indexes

func (r Node) Indexes() []model.Index

func (Node) ProcessDefaults

func (r Node) ProcessDefaults(ctx context.Context) error

func (Node) Resource

func (r Node) Resource() model.Resource

func (Node) SetResource

func (r Node) SetResource(pr model.Resource) error

SetResource implements the Object.SetResource interface.

func (Node) Type

func (r Node) Type() model.Type

func (Node) Validate

func (r Node) Validate(ctx context.Context) error

type NodeStatus

type NodeStatus struct {
	NodeStatus *nonPublic.NodeStatus
}

func NewNodeStatus

func NewNodeStatus() NodeStatus

func (NodeStatus) ID

func (r NodeStatus) ID() string

func (NodeStatus) Indexes

func (r NodeStatus) Indexes() []model.Index

func (NodeStatus) ProcessDefaults

func (r NodeStatus) ProcessDefaults(_ context.Context) error

func (NodeStatus) Resource

func (r NodeStatus) Resource() model.Resource

func (NodeStatus) SetResource

func (r NodeStatus) SetResource(pr model.Resource) error

SetResource implements the Object.SetResource interface.

func (NodeStatus) Type

func (r NodeStatus) Type() model.Type

func (NodeStatus) Validate

func (r NodeStatus) Validate(_ context.Context) error

type Plugin

type Plugin struct {
	Plugin *v1.Plugin
}

func NewPlugin

func NewPlugin() Plugin

func (Plugin) ID

func (r Plugin) ID() string

func (Plugin) Indexes

func (r Plugin) Indexes() []model.Index

func (Plugin) ProcessDefaults

func (r Plugin) ProcessDefaults(ctx context.Context) error

func (Plugin) Resource

func (r Plugin) Resource() model.Resource

func (Plugin) SetResource

func (r Plugin) SetResource(pr model.Resource) error

SetResource implements the Object.SetResource interface.

func (Plugin) Type

func (r Plugin) Type() model.Type

func (Plugin) Validate

func (r Plugin) Validate(ctx context.Context) error

type PluginSchema

type PluginSchema struct {
	PluginSchema *v1.PluginSchema
}

PluginSchema represents the schema attributes for a plugin.

func NewPluginSchema

func NewPluginSchema() PluginSchema

NewPluginSchema defines a new PluginSchema instance.

func (PluginSchema) ID

func (r PluginSchema) ID() string

ID utilizes the plugin name as the ID.

func (PluginSchema) Indexes

func (r PluginSchema) Indexes() []model.Index

func (PluginSchema) ProcessDefaults

func (r PluginSchema) ProcessDefaults(ctx context.Context) error

func (PluginSchema) Resource

func (r PluginSchema) Resource() model.Resource

func (PluginSchema) SetResource

func (r PluginSchema) SetResource(pr model.Resource) error

SetResource implements the Object.SetResource interface.

func (PluginSchema) Type

func (r PluginSchema) Type() model.Type

func (PluginSchema) Validate

func (r PluginSchema) Validate(ctx context.Context) error

type Route

type Route struct {
	Route *v1.Route
}

func NewRoute

func NewRoute() Route

func (Route) ID

func (r Route) ID() string

func (Route) Indexes

func (r Route) Indexes() []model.Index

func (Route) ProcessDefaults

func (r Route) ProcessDefaults(ctx context.Context) error

func (Route) Resource

func (r Route) Resource() model.Resource

func (Route) SetResource

func (r Route) SetResource(pr model.Resource) error

SetResource implements the Object.SetResource interface.

func (Route) Type

func (r Route) Type() model.Type

func (Route) Validate

func (r Route) Validate(ctx context.Context) error

type SNI

type SNI struct {
	SNI *v1.SNI
}

func NewSNI

func NewSNI() SNI

func (SNI) ID

func (r SNI) ID() string

func (SNI) Indexes

func (r SNI) Indexes() []model.Index

func (SNI) ProcessDefaults

func (r SNI) ProcessDefaults(ctx context.Context) error

func (SNI) Resource

func (r SNI) Resource() model.Resource

func (SNI) SetResource

func (r SNI) SetResource(pr model.Resource) error

SetResource implements the Object.SetResource interface.

func (SNI) Type

func (r SNI) Type() model.Type

func (SNI) Validate

func (r SNI) Validate(ctx context.Context) error

type Service

type Service struct {
	Service *v1.Service
}

func NewService

func NewService() Service

func (Service) ID

func (r Service) ID() string

func (Service) Indexes

func (r Service) Indexes() []model.Index

func (Service) ProcessDefaults

func (r Service) ProcessDefaults(ctx context.Context) error

func (Service) Resource

func (r Service) Resource() model.Resource

func (Service) SetResource

func (r Service) SetResource(pr model.Resource) error

SetResource implements the Object.SetResource interface.

func (Service) Type

func (r Service) Type() model.Type

func (Service) Validate

func (r Service) Validate(ctx context.Context) error

type Target

type Target struct {
	Target *v1.Target
}

func NewTarget

func NewTarget() Target

func (Target) ID

func (t Target) ID() string

func (Target) Indexes

func (t Target) Indexes() []model.Index

func (Target) ProcessDefaults

func (t Target) ProcessDefaults(ctx context.Context) error

func (Target) Resource

func (t Target) Resource() model.Resource

func (Target) SetResource

func (t Target) SetResource(r model.Resource) error

SetResource implements the Object.SetResource interface.

func (Target) Type

func (t Target) Type() model.Type

func (Target) Validate

func (t Target) Validate(ctx context.Context) error

type Upstream

type Upstream struct {
	Upstream *v1.Upstream
}

func NewUpstream

func NewUpstream() Upstream

func (Upstream) ID

func (r Upstream) ID() string

func (Upstream) Indexes

func (r Upstream) Indexes() []model.Index

func (Upstream) ProcessDefaults

func (r Upstream) ProcessDefaults(ctx context.Context) error

func (Upstream) Resource

func (r Upstream) Resource() model.Resource

func (Upstream) SetResource

func (r Upstream) SetResource(pr model.Resource) error

SetResource implements the Object.SetResource interface.

func (Upstream) Type

func (r Upstream) Type() model.Type

func (Upstream) Validate

func (r Upstream) Validate(ctx context.Context) error

Jump to

Keyboard shortcuts

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