knative

package
v0.44.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultWaitingTimeout     = 120 * time.Second
	DefaultErrorWindowTimeout = 2 * time.Second
)
View Source
const (
	DaprEnabled          = "true"
	DaprMetricsPort      = "9092"
	DaprEnableAPILogging = "true"
)
View Source
const LIVENESS_ENDPOINT = "/health/liveness"
View Source
const READINESS_ENDPOINT = "/health/readiness"
View Source
const RemoveTimeout = 120 * time.Second

Variables

This section is empty.

Functions

func ActiveNamespace added in v0.41.0

func ActiveNamespace() string

ActiveNamespace attempts to read the Kubernetes active namespace. Missing configs or not having an active Kubernetes configuration are equivalent to having no default namespace (empty string).

func GetKServiceLogs

func GetKServiceLogs(ctx context.Context, namespace, kServiceName, image string, since *time.Time, out io.Writer) error

GetKServiceLogs will get logs of Knative service.

It will do so by gathering logs of user-container of all affiliated pods. In addition, filtering on image can be done so only logs for given image are logged. The image must be the digest format since pods of Knative service use it.

This function runs as long as the passed context is active (i.e. it is required cancel the context to stop log gathering).

func NewEventingClient

func NewEventingClient(namespace string) (clienteventingv1.KnEventingClient, error)

func NewServingClient

func NewServingClient(namespace string) (clientservingv1.KnServingClient, error)

Types

type DeployDecorator

type DeployDecorator interface {
	UpdateAnnotations(fn.Function, map[string]string) map[string]string
	UpdateLabels(fn.Function, map[string]string) map[string]string
}

type Deployer

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

func NewDeployer

func NewDeployer(opts ...DeployerOpt) *Deployer

func (*Deployer) Deploy

func (d *Deployer) Deploy(ctx context.Context, f fn.Function) (fn.DeploymentResult, error)

type DeployerOpt

type DeployerOpt func(*Deployer)

func WithDeployerDecorator

func WithDeployerDecorator(decorator DeployDecorator) DeployerOpt

func WithDeployerVerbose

func WithDeployerVerbose(verbose bool) DeployerOpt

type Describer

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

func NewDescriber

func NewDescriber(verbose bool) *Describer

func (*Describer) Describe

func (d *Describer) Describe(ctx context.Context, name, namespace string) (description fn.Instance, err error)

Describe a function by name. Note that the consuming API uses domain style notation, whereas Kubernetes restricts to label-syntax, which is thus escaped. Therefore as a knative (kube) implementation detal proper full names have to be escaped on the way in and unescaped on the way out. ex: www.example-site.com -> www-example--site-com

type Lister

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

func NewLister

func NewLister(verbose bool) *Lister

func (*Lister) List

func (l *Lister) List(ctx context.Context, namespace string) (items []fn.ListItem, err error)

List functions, optionally specifying a namespace.

type Remover

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

func NewRemover

func NewRemover(verbose bool) *Remover

func (*Remover) Remove

func (remover *Remover) Remove(ctx context.Context, name, ns string) (err error)

type SynchronizedBuffer

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

func (*SynchronizedBuffer) Read

func (b *SynchronizedBuffer) Read(p []byte) (n int, err error)

func (*SynchronizedBuffer) Reset

func (b *SynchronizedBuffer) Reset()

func (*SynchronizedBuffer) String

func (b *SynchronizedBuffer) String() string

func (*SynchronizedBuffer) Write

func (b *SynchronizedBuffer) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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