actions

package
v0.0.0-...-d2f00f9 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package actions defines all the discrete actions of available to the CLI

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TemplateRun

func TemplateRun(datadir string) error

TemplateRun generates all templates for the given directory.

Types

type Client

type Client struct {
	*Telemetry

	ConfigFiles []string
	// contains filtered or unexported fields
}

Client is the action group for all client commands.

func (*Client) AddClientConfigOverride

func (action *Client) AddClientConfigOverride(override ...ClientConfigOverride)

AddClientConfigOverride adds an override function that will be called in GetConfig to edit config after loading.

func (*Client) GetClientConfig

func (action *Client) GetClientConfig(ctx context.Context) (*v1alpha1.ClientConfiguration, error)

GetClientConfig returns the client's configuration object.

func (*Client) NewHandler

func (action *Client) NewHandler(ctx context.Context) (http.Handler, error)

NewHandler constructs a new http handler (DEPRECATED) TODO convert this to not return a http.Handler but instead start a local HTTP server on port 0 (any port).

type ClientConfig

type ClientConfig struct {
	*Client

	Sample bool
}

ClientConfig is an action for managing the client configuration.

func (*ClientConfig) Run

func (action *ClientConfig) Run(ctx context.Context, out io.Writer) error

Run is the action method.

type ClientConfigOverride

type ClientConfigOverride func(ctx context.Context, c *v1alpha1.ClientConfiguration) error

ClientConfigOverride is a function used to override the client configuration.

type Config

type Config struct {
	*Telemetry

	Sample bool
}

Config is the action for getting the server configuration.

func (*Config) Run

func (action *Config) Run(ctx context.Context, out io.Writer) error

Run is the action method.

type Download

type Download struct {
	*Client

	Since      string
	BatchSize  int
	All        bool
	FromLatest bool
}

Download is the action for the download operations.

func (*Download) Run

func (action *Download) Run(ctx context.Context, path, telemetryServerURL string) error

Run is the action method.

type Serve

type Serve struct {
	*Telemetry

	Listen string
}

Serve is the action for starting the server.

func (*Serve) Run

func (action *Serve) Run(ctx context.Context) error

Run is the action method.

type ServerConfigOverride

type ServerConfigOverride func(ctx context.Context, c *v1alpha1.ServerConfiguration) error

ServerConfigOverride is a function used to override the server configuration.

type Telemetry

type Telemetry struct {
	ConfigFiles []string
	// contains filtered or unexported fields
}

Telemetry action for all commands.

func NewTelemetry

func NewTelemetry(info version.Info) *Telemetry

NewTelemetry creates a new telemetry action versionOverride is the optional build version provided by the build system (not necessarily GIT).

func (*Telemetry) AddServerConfigOverride

func (action *Telemetry) AddServerConfigOverride(override ...ServerConfigOverride)

AddServerConfigOverride adds an override function that will be called in GetConfig to edit config after loading.

func (*Telemetry) GetConfigScheme

func (action *Telemetry) GetConfigScheme() *runtime.Scheme

GetConfigScheme returns the runtime scheme used for configuration file loading.

func (*Telemetry) GetServerConfig

func (action *Telemetry) GetServerConfig(ctx context.Context) (*v1alpha1.ServerConfiguration, error)

GetServerConfig returns the server configuration.

func (Telemetry) GetVersionInfo

func (action Telemetry) GetVersionInfo() version.Info

GetVersionInfo returns the version information (overwritten by main.version if needed).

type Upload

type Upload struct {
	*Client

	All         bool
	SkipInvalid bool
}

Upload is the upload action.

func (*Upload) Run

func (action *Upload) Run(ctx context.Context, path, telemetryServerURL string) error

Run is the action method.

Jump to

Keyboard shortcuts

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