apiserver

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 68 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientConfig

func NewClientConfig(opts ...ClientOption) *rest.Config

NewClientConfig returns a new local client configuration.

func NewKineStorage

func NewKineStorage(ctx context.Context, dsn string) (rest.StoreFn, error)

NewKineStorage creates a new kine storage.

Types

type ClientOption

type ClientOption func(*clientOptions)

ClientOption is a set of options for the client.

func WithBearerToken

func WithBearerToken(token string) ClientOption

WithBearerToken sets the token for the client.

func WithClientHost

func WithClientHost(host string) ClientOption

WithClientHost sets the host for the client. The default host is "localhost:8443".

func WithClientTLSConfig

func WithClientTLSConfig(tlsConfig rest.TLSClientConfig) ClientOption

WithClientTLSConfig sets the TLS configuration for the client. If not set, the client will use an insecure configuration.

func WithTransportWrapper

func WithTransportWrapper(fn transport.WrapperFunc) ClientOption

WithTransportWrapper sets the transport wrapper for the client.

type Controller added in v0.3.32

type Controller interface {
	SetupWithManager(ctx context.Context, mgr ctrl.Manager) error
	Reconcile(ctx context.Context, request reconcile.Request) (ctrl.Result, error)
}

type CreateController added in v0.3.32

type CreateController func(client.Client) Controller

type Manager

type Manager struct {
	ReadyCh chan error
	// contains filtered or unexported fields
}

Manager manages APIServer instance as well as built-in controllers.

func New

func New() *Manager

New creates a new API server manager.

func (*Manager) Start

func (m *Manager) Start(
	ctx context.Context,
	gwSrv *gw.Server,
	tc tclient.Client,
	opts ...Option,
) error

Start starts the API server manager with the given options and blocks forever or until the context is canceled (whichever comes first). It returns an error if the manager fails to start. The manager is ready to serve when the ReadyCh channel is closed.

type Option

type Option func(*options)

Option is an API server option.

func WithAdditionalController added in v0.3.32

func WithAdditionalController(c CreateController) Option

WithAdditionalController adds an additional controller.

func WithCerts

func WithCerts(certPairName, certDir string) Option

WithCerts sets the certificate pair name and directory.

func WithClientConfig

func WithClientConfig(cfg *rest.Config) Option

WithClientConfig sets the client configuration.

func WithInClusterAuth

func WithInClusterAuth() Option

WithInClusterAuth enables in-cluster authentication.

func WithInMemorySQLite

func WithInMemorySQLite() Option

WithSQLiteConnArgs sets the SQLite connection arguments.

func WithKubeAPI added in v0.3.30

func WithKubeAPI() Option

WithKubeAPI enables the Kubernetes API.

func WithSQLiteConnArgs

func WithSQLiteConnArgs(args map[string]string) Option

WithSQLiteConnArgs sets the SQLite connection arguments. The default values are:

cache=shared
_journal_mode=WAL
_busy_timeout=30000

func WithSQLitePath

func WithSQLitePath(path string) Option

WithSQLitePath sets the path to the SQLite database. If empty, in-memory database will be used.

func WithSimpleAuth

func WithSimpleAuth() Option

WithSimpleAuth enables authentication.

Directories

Path Synopsis
Package auth contains APIServer authentication helpers.
Package auth contains APIServer authentication helpers.
Package controllers implements Apoxy Control Plane-side controllers.
Package controllers implements Apoxy Control Plane-side controllers.
Package extensions implements extensions controllers.
Package extensions implements extensions controllers.
Package gateway implements Gateway API controllers.
Package gateway implements Gateway API controllers.
Package policy implements API Server policy controllers.
Package policy implements API Server policy controllers.

Jump to

Keyboard shortcuts

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