apiserver

package
v0.3.26 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: Apache-2.0 Imports: 66 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:443".

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 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 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 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