Documentation ¶
Overview ¶
Package client provides the interface through which Inertia communicates with a serverside daemon
Index ¶
- Variables
- type AuthenticateRequest
- type Client
- func (c *Client) Down(ctx context.Context) error
- func (c *Client) GetSSHClient() (*SSHClient, error)
- func (c *Client) GetUserClient() *UserClient
- func (c *Client) ListEnv(ctx context.Context) ([]string, error)
- func (c *Client) Logs(ctx context.Context, req LogsRequest) ([]string, error)
- func (c *Client) LogsWithOutput(ctx context.Context, req LogsRequest) error
- func (c *Client) Prune(ctx context.Context) error
- func (c *Client) Reset(ctx context.Context) error
- func (c *Client) Status(ctx context.Context) (*api.DeploymentStatus, error)
- func (c *Client) Token(ctx context.Context) (token string, err error)
- func (c *Client) Up(ctx context.Context, req UpRequest) error
- func (c *Client) UpWithOutput(ctx context.Context, req UpRequest) error
- func (c *Client) UpdateEnv(ctx context.Context, name, value string, encrypt, remove bool) error
- func (c *Client) WithDebug(debug bool)
- func (c *Client) WithWriter(out io.Writer)
- type LogsRequest
- type Options
- type SSHClient
- func (s *SSHClient) AssignAPIToken() error
- func (s *SSHClient) DaemonDown() error
- func (s *SSHClient) DaemonUp() error
- func (s *SSHClient) GenerateKeys() (string, error)
- func (s *SSHClient) GetRunner() runner.SSHSession
- func (s *SSHClient) InstallDocker() error
- func (s *SSHClient) UninstallInertia() error
- type SocketReader
- type UpRequest
- type UserClient
- func (u *UserClient) AddUser(ctx context.Context, username, password string, admin bool) error
- func (u *UserClient) Authenticate(ctx context.Context, req AuthenticateRequest) (token string, err error)
- func (u *UserClient) DisableTotp(ctx context.Context) error
- func (u *UserClient) EnableTotp(ctx context.Context, username, password string) (*api.TotpResponse, error)
- func (u *UserClient) ListUsers(ctx context.Context) ([]string, error)
- func (u *UserClient) RemoveUser(ctx context.Context, username string) error
- func (u *UserClient) ResetUsers(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNeedTotp is used to indicate that a 2FA-enabled user has not provided a TOTP ErrNeedTotp = errors.New("TOTP is needed for user") )
Functions ¶
This section is empty.
Types ¶
type AuthenticateRequest ¶ added in v0.6.0
AuthenticateRequest denotes options for authenticating with the Inertia daemon
type Client ¶ added in v0.4.0
Client manages a deployment
func NewClient ¶ added in v0.4.0
NewClient sets up a client to communicate to the daemon at the given remote
func (*Client) Down ¶ added in v0.4.0
Down brings the project down on the remote VPS instance specified in the configuration object.
func (*Client) GetSSHClient ¶ added in v0.6.0
GetSSHClient instantiates an SSH client for Inertia-related commands
func (*Client) GetUserClient ¶ added in v0.6.0
func (c *Client) GetUserClient() *UserClient
GetUserClient instantiates an API client for Inertia user management commands
func (*Client) ListEnv ¶ added in v0.4.0
ListEnv lists environment variables currently set on remote
func (*Client) LogsWithOutput ¶ added in v0.6.0
func (c *Client) LogsWithOutput(ctx context.Context, req LogsRequest) error
LogsWithOutput opens a websocket connection to given container's logs and streams it to the given io.Writer
func (*Client) Reset ¶ added in v0.4.0
Reset shuts down deployment and deletes the contents of the deployment's project directory
func (*Client) Status ¶ added in v0.4.0
Status lists the currently active containers on the remote VPS instance
func (*Client) Up ¶ added in v0.4.0
Up brings the project up on the remote VPS instance specified in the deployment object.
func (*Client) UpWithOutput ¶ added in v0.6.0
UpWithOutput blocks and streams 'up' output to the client's io.Writer
func (*Client) WithWriter ¶ added in v0.6.0
WithWriter sets the given io.Writer as the client's default output
type LogsRequest ¶ added in v0.6.0
LogsRequest denotes parameters for log querying
type Options ¶ added in v0.6.0
type Options struct { SSH runner.SSHOptions Out io.Writer Debug bool }
Options denotes configuration options for a Client
type SSHClient ¶ added in v0.6.0
type SSHClient struct {
// contains filtered or unexported fields
}
SSHClient implements Inertia's SSH commands
func (*SSHClient) AssignAPIToken ¶ added in v0.6.0
AssignAPIToken generates an API token and assigns it to client.Remote
func (*SSHClient) DaemonDown ¶ added in v0.6.0
DaemonDown brings the daemon down on the remote instance
func (*SSHClient) GenerateKeys ¶ added in v0.6.0
GenerateKeys creates a public-private key-pair on the remote vps and returns the public key.
func (*SSHClient) GetRunner ¶ added in v0.6.0
func (s *SSHClient) GetRunner() runner.SSHSession
GetRunner returns the SSH client's underlying session
func (*SSHClient) InstallDocker ¶ added in v0.6.0
InstallDocker installs docker on a remote vps.
func (*SSHClient) UninstallInertia ¶ added in v0.6.0
UninstallInertia removes the inertia/ directory on the remote instance
type SocketReader ¶ added in v0.4.0
SocketReader is an interface to a websocket connection
type UserClient ¶ added in v0.6.0
type UserClient struct {
// contains filtered or unexported fields
}
UserClient is used to access Inertia's /user APIs
func NewUserClient ¶ added in v0.6.0
func NewUserClient(c *Client) *UserClient
NewUserClient instantiates a new client for user management functions
func (*UserClient) AddUser ¶ added in v0.6.0
AddUser adds an authorized user for access to Inertia Web
func (*UserClient) Authenticate ¶ added in v0.6.0
func (u *UserClient) Authenticate(ctx context.Context, req AuthenticateRequest) (token string, err error)
Authenticate gets an access token for the user with the given credentials. Use "" for totp if none is required.
func (*UserClient) DisableTotp ¶ added in v0.6.0
func (u *UserClient) DisableTotp(ctx context.Context) error
DisableTotp disables Totp for a given user
func (*UserClient) EnableTotp ¶ added in v0.6.0
func (u *UserClient) EnableTotp(ctx context.Context, username, password string) (*api.TotpResponse, error)
EnableTotp enables Totp for a given user
func (*UserClient) ListUsers ¶ added in v0.6.0
func (u *UserClient) ListUsers(ctx context.Context) ([]string, error)
ListUsers lists all users on the remote.
func (*UserClient) RemoveUser ¶ added in v0.6.0
func (u *UserClient) RemoveUser(ctx context.Context, username string) error
RemoveUser prevents a user from accessing Inertia Web
func (*UserClient) ResetUsers ¶ added in v0.6.0
func (u *UserClient) ResetUsers(ctx context.Context) error
ResetUsers resets all users on the remote.
Directories ¶
Path | Synopsis |
---|---|
Package bootstrap provides Inertia's remote bootstrapping script, based off of inertia/client.Client
|
Package bootstrap provides Inertia's remote bootstrapping script, based off of inertia/client.Client |
Package internal provides compiled scripts and other internal assets
|
Package internal provides compiled scripts and other internal assets |
Package runner provides the Inertia client's low-level SSH command runner
|
Package runner provides the Inertia client's low-level SSH command runner |
mocks
Package mocks provides mocked implmentations of interfaces in client/runner Code generated by counterfeiter.
|
Package mocks provides mocked implmentations of interfaces in client/runner Code generated by counterfeiter. |