tool

package
v0.23.5 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DashboardCmd

func DashboardCmd(spec *DashboardSpec) *tool.Command

DashboardCmd implements the "weaver dashboard" command. "weaver dashboard" hosts a webpage that returns information about the current set of Service Weaver applications.

func DeployCmd

func DeployCmd(spec *DeploySpec) *tool.Command

DeployCmd returns the "deploy" command.

func KillCmd

func KillCmd(spec *KillSpec) *tool.Command

KillCmd implements the "weaver kill" command. "weaver kill" kills a Service Weaver application.

func ProfileCmd

func ProfileCmd(spec *ProfileSpec) *tool.Command

ProfileCmd implements the "weaver profile" command. "weaver profile" profiles a running Service Weaver application.

func StatusCmd

func StatusCmd(spec *StatusSpec) *tool.Command

StatusCmd implements the "weaver status" command. "weaver status" returns information about the current set of Service Weaver applications. It is similar to running "git status" or "kubectl get".

func StoreCmd

func StoreCmd(spec *StoreSpec) *tool.Command

StoreCmd returns the "store" command.

Types

type Command

type Command struct {
	Label   string // e.g., cat logs
	Command string // e.g., weaver gke logs '--version=="12345678"'
}

A Command is a labeled terminal command that a user can run. We show these commands on the dashboard so that users can copy and run them.

type DashboardSpec

type DashboardSpec struct {
	Tool  string        // e.g., weaver-gke, weaver-gke-local
	Flags *flag.FlagSet // command line flags

	// Controller returns the HTTP address of the controller and an HTTP client
	// that we can use to contact the controller.
	Controller func(context.Context) (string, *http.Client, error)

	// Initializes the dashboard.
	Init func(ctx context.Context, mux *http.ServeMux) error

	AppLinks           func(ctx context.Context, app string) (Links, error)          // app links
	DeploymentLinks    func(ctx context.Context, app, version string) (Links, error) // version links
	AppCommands        func(app string) []Command                                    // app commands
	DeploymentCommands func(depId string) []Command                                  // deployment commands
}

DashboardSpec configures the command returned by DashboardCmd.

type DeploySpec

type DeploySpec struct {
	Tool  string        // e.g., weaver-gke, weaver-gke-local
	Flags *flag.FlagSet // command line flags

	// Controller returns the HTTP address of the controller and an HTTP client
	// that we can use to contact the controller.
	Controller func(context.Context, *config.GKEConfig) (string, *http.Client, error)

	PrepareRollout func(context.Context, *config.GKEConfig) (*controller.RolloutRequest, error)
	Source         func(context.Context, *config.GKEConfig) (logging.Source, error)
	// contains filtered or unexported fields
}

type KillSpec

type KillSpec struct {
	Tool  string        // e.g., weaver-gke, weaver-gke-local
	Flags *flag.FlagSet // command line flags

	// Controller returns the HTTP address of the controller and an HTTP client
	// that we can use to contact the controller.
	Controller func(context.Context) (string, *http.Client, error)
	// contains filtered or unexported fields
}
type Links struct {
	Logs    string // link to logs
	Metrics string // link to metrics
	Traces  string // link to traces
}

Links contains links to display on a status page. If a link is empty, the link is omitted.

type ProfileSpec

type ProfileSpec struct {
	Tool       string        // e.g., weaver-gke, weaver-gke-local
	Flags      *flag.FlagSet // command line flags
	GetProfile func(ctx context.Context, req *protos.GetProfileRequest) (*protos.GetProfileReply, error)

	// Controller returns the HTTP address of the controller and an HTTP client
	// that can be used to contact the controller.
	Controller func(context.Context) (string, *http.Client, error)
	// contains filtered or unexported fields
}

type StatusSpec

type StatusSpec struct {
	Tool  string        // e.g., weaver-gke, weaver-gke-local
	Flags *flag.FlagSet // command line flags

	// Controller returns the HTTP address of the controller and an HTTP client
	// that we can use to contact the controller.
	Controller func(context.Context) (string, *http.Client, error)
}

type StoreSpec

type StoreSpec struct {
	Tool  string // e.g., weaver-gke, weaver-gke-local
	Flags *flag.FlagSet
	Store func(context.Context) (store.Store, error)
}

Directories

Path Synopsis
testprogram is used by version tests.
testprogram is used by version tests.

Jump to

Keyboard shortcuts

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