Documentation ¶
Overview ¶
Package client contains the Waypoint client implementation.
The Waypoint client exposes a slightly higher level of abstraction than direct a API client for performing operations on an application. The primary consumer of this package is the CLI.
Index ¶
- func TestApp(t testing.T, c *Project) string
- type App
- func (c *App) Auth(ctx context.Context, op *pb.Job_AuthOp) (*pb.Job_AuthResult, error)
- func (c *App) Build(ctx context.Context, op *pb.Job_BuildOp) (*pb.Job_BuildResult, error)
- func (c *App) ConfigSync(ctx context.Context, op *pb.Job_ConfigSyncOp) (*pb.Job_ConfigSyncResult, error)
- func (c *App) Deploy(ctx context.Context, op *pb.Job_DeployOp) (*pb.Job_DeployResult, error)
- func (c *App) Destroy(ctx context.Context, op *pb.Job_DestroyOp) error
- func (c *App) Docs(ctx context.Context, op *pb.Job_DocsOp) (*pb.Job_DocsResult, error)
- func (c *App) Exec(ctx context.Context, op *pb.Job_ExecOp, mon chan pb.Job_State) error
- func (a *App) Logs(ctx context.Context) (pb.Waypoint_GetLogStreamClient, error)
- func (c *App) Noop(ctx context.Context) error
- func (c *App) PushBuild(ctx context.Context, op *pb.Job_PushOp) error
- func (c *App) Ref() *pb.Ref_Application
- func (c *App) Release(ctx context.Context, op *pb.Job_ReleaseOp) (*pb.Job_ReleaseResult, error)
- func (c *App) StatusReport(ctx context.Context, op *pb.Job_StatusReportOp) (*pb.Job_StatusReportResult, error)
- func (c *App) Up(ctx context.Context, op *pb.Job_UpOp) (*pb.Job_Result, error)
- type Option
- func WithClient(client pb.WaypointClient) Option
- func WithClientConnect(opts ...serverclient.ConnectOption) Option
- func WithLabels(m map[string]string) Option
- func WithLocal() Option
- func WithLogger(log hclog.Logger) Option
- func WithProjectRef(ref *pb.Ref_Project) Option
- func WithSourceOverrides(m map[string]string) Option
- func WithUI(ui terminal.UI) Option
- func WithWorkspaceRef(ref *pb.Ref_Workspace) Option
- type Project
- func (c *Project) App(n string) *App
- func (c *Project) Client() pb.WaypointClient
- func (c *Project) Close() error
- func (c *Project) Local() bool
- func (c *Project) LocalRunnerId() (string, bool)
- func (c *Project) Ref() *pb.Ref_Project
- func (c *Project) ServerVersion() *pb.VersionInfo
- func (c *Project) Validate(ctx context.Context, op *pb.Job_ValidateOp) (*pb.Job_ValidateResult, error)
- func (c *Project) WorkspaceRef() *pb.Ref_Workspace
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
App is used for application-specific operations.
func (*App) Auth ¶
func (c *App) Auth(ctx context.Context, op *pb.Job_AuthOp) (*pb.Job_AuthResult, error)
func (*App) Build ¶
func (c *App) Build(ctx context.Context, op *pb.Job_BuildOp) (*pb.Job_BuildResult, error)
func (*App) ConfigSync ¶ added in v0.2.0
func (c *App) ConfigSync(ctx context.Context, op *pb.Job_ConfigSyncOp) (*pb.Job_ConfigSyncResult, error)
func (*App) Deploy ¶
func (c *App) Deploy(ctx context.Context, op *pb.Job_DeployOp) (*pb.Job_DeployResult, error)
func (*App) Docs ¶
func (c *App) Docs(ctx context.Context, op *pb.Job_DocsOp) (*pb.Job_DocsResult, error)
func (*App) Noop ¶
Noop executes a noop operation. This is primarily for testing but is exported since it has its uses in verifying a runner is functioning properly.
A noop operation will exercise the full logic of queueing a job, assigning it to a runner, dequeueing as a runner, executing, etc. It will use real remote runners if the client is configured to do so.
func (*App) Ref ¶
func (c *App) Ref() *pb.Ref_Application
Ref returns the application reference that this client is using.
func (*App) Release ¶
func (c *App) Release(ctx context.Context, op *pb.Job_ReleaseOp) (*pb.Job_ReleaseResult, error)
func (*App) StatusReport ¶ added in v0.4.0
func (c *App) StatusReport(ctx context.Context, op *pb.Job_StatusReportOp) (*pb.Job_StatusReportResult, error)
type Option ¶
func WithClient ¶
func WithClient(client pb.WaypointClient) Option
WithClient sets the client directly. In this case, the runner won't attempt any connection at all regardless of other configuration (env vars or waypoint config file). This will be used.
func WithClientConnect ¶
func WithClientConnect(opts ...serverclient.ConnectOption) Option
WithClientConnect specifies the options for connecting to a client. If WithClient is specified, that client is always used.
If WithLocal is set and no client is specified and no server creds can be found, then an in-process server will be created.
func WithLabels ¶
WithLabels sets the labels or any operations.
func WithLocal ¶
func WithLocal() Option
WithLocal puts the client in local exec mode. In this mode, the client will spin up a per-operation runner locally and reference the local on-disk data for all operations.
func WithLogger ¶
func WithLogger(log hclog.Logger) Option
WithLogger sets the logger for the client.
func WithProjectRef ¶
func WithProjectRef(ref *pb.Ref_Project) Option
WithProjectRef sets the project reference for all operations performed.
func WithSourceOverrides ¶
WithSourceOverrides sets the data source overrides for queued jobs.
func WithWorkspaceRef ¶
func WithWorkspaceRef(ref *pb.Ref_Workspace) Option
WithWorkspaceRef sets the workspace reference for all operations performed. If this isn't set, the default workspace will be used.
type Project ¶
Project is the primary structure for interacting with a Waypoint server as a client. The client exposes a slightly higher level of abstraction over the server API for performing operations locally and remotely.
func TestProject ¶
TestProject returns an initialized client pointing to an in-memory test server. This will close automatically on test completion.
This will also change the working directory to a temporary directory so that any side effect file creation doesn't impact the real working directory. If you need to use your working directory, query it before calling this.
func (*Project) Client ¶
func (c *Project) Client() pb.WaypointClient
Client returns the raw Waypoint server API client.
func (*Project) LocalRunnerId ¶ added in v0.3.0
LocalRunnerId returns the id of the runner that this project started This is used to target jobs specifically at this runner.
func (*Project) Ref ¶
func (c *Project) Ref() *pb.Ref_Project
Ref returns the raw Waypoint server API client.
func (*Project) ServerVersion ¶ added in v0.3.1
func (c *Project) ServerVersion() *pb.VersionInfo
ServerVersion returns the server version that this client is connected to.
func (*Project) Validate ¶
func (c *Project) Validate(ctx context.Context, op *pb.Job_ValidateOp) (*pb.Job_ValidateResult, error)
func (*Project) WorkspaceRef ¶
func (c *Project) WorkspaceRef() *pb.Ref_Workspace
WorkspaceRef returns the application reference that this client is using.