Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- func (c Client) DelDevURL(ctx context.Context, envID, urlID string) error
- func (c *Client) DeleteSecretByName(ctx context.Context, name, userID string) error
- func (c Client) DialWsep(ctx context.Context, env *Environment) (*websocket.Conn, error)
- func (c Client) EnvironmentsByOrganization(ctx context.Context, userID, orgID string) ([]Environment, error)
- func (c Client) InsertDevURL(ctx context.Context, envID string, port int, name, access string) error
- func (c *Client) InsertSecret(ctx context.Context, user *User, req InsertSecretReq) error
- func (c Client) Me(ctx context.Context) (*User, error)
- func (c Client) Orgs(ctx context.Context) ([]Org, error)
- func (c Client) PushActivity(ctx context.Context, source string, envID string) error
- func (c Client) SSHKey(ctx context.Context) (*SSHKey, error)
- func (c *Client) SecretByName(ctx context.Context, name, userID string) (*Secret, error)
- func (c *Client) SecretWithValueByID(ctx context.Context, id, userID string) (*Secret, error)
- func (c *Client) SecretWithValueByName(ctx context.Context, name, userID string) (*Secret, error)
- func (c *Client) Secrets(ctx context.Context, userID string) ([]Secret, error)
- func (c Client) UpdateDevURL(ctx context.Context, envID, urlID string, port int, name, access string) error
- func (c Client) UserByEmail(ctx context.Context, email string) (*User, error)
- func (c Client) UserByID(ctx context.Context, id string) (*User, error)
- func (c Client) Users(ctx context.Context) ([]User, error)
- type DevURL
- type Environment
- type InsertSecretReq
- type Org
- type SSHKey
- type Secret
- type User
Constants ¶
const Me = "me"
Me is the route param to access resources of the authenticated user
Variables ¶
var ErrNotFound = xerrors.Errorf("resource not found")
ErrNotFound describes an error case in which the requested resource could not be found
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client wraps the Coder HTTP API
func (*Client) DeleteSecretByName ¶
DeleteSecretByName deletes the authenticated users secret with the given name
func (Client) DialWsep ¶
DialWsep dials an environments command execution interface See github.com/cdr/wsep for details
func (Client) EnvironmentsByOrganization ¶
func (c Client) EnvironmentsByOrganization(ctx context.Context, userID, orgID string) ([]Environment, error)
EnvironmentsByOrganization gets the list of environments owned by the given user.
func (Client) InsertDevURL ¶
func (c Client) InsertDevURL(ctx context.Context, envID string, port int, name, access string) error
InsertDevURL inserts a new devurl for the authenticated user
func (*Client) InsertSecret ¶
InsertSecret adds a new secret for the authed user
func (Client) PushActivity ¶
PushActivity pushes CLI activity to Coder.
func (*Client) SecretByName ¶
SecretByName gets a secret object by name
func (*Client) SecretWithValueByID ¶
SecretWithValueByID gets the Coder secret with its value by the secret_id.
func (*Client) SecretWithValueByName ¶
SecretWithValueByName gets the Coder secret with its value by its name.
func (Client) UpdateDevURL ¶
func (c Client) UpdateDevURL(ctx context.Context, envID, urlID string, port int, name, access string) error
UpdateDevURL updates an existing devurl for the authenticated user
func (Client) UserByEmail ¶
UserByEmail gets a user by email.
type DevURL ¶
type DevURL struct { ID string `json:"id"` URL string `json:"url"` Port int `json:"port"` Access string `json:"access"` Name string `json:"name"` }
DevURL is the parsed json response record for a devURL from cemanager
type Environment ¶
type Environment struct { ID string `json:"id" tab:"-"` Name string `json:"name"` ImageID string `json:"image_id" tab:"-"` ImageTag string `json:"image_tag"` OrganizationID string `json:"organization_id" tab:"-"` UserID string `json:"user_id" tab:"-"` LastBuiltAt time.Time `json:"last_built_at" tab:"-"` CPUCores float32 `json:"cpu_cores"` MemoryGB int `json:"memory_gb"` DiskGB int `json:"disk_gb"` GPUs int `json:"gpus"` Updating bool `json:"updating"` RebuildMessages []struct { Text string `json:"text"` Required bool `json:"required"` } `json:"rebuild_messages" tab:"-"` CreatedAt time.Time `json:"created_at" tab:"-"` UpdatedAt time.Time `json:"updated_at" tab:"-"` LastOpenedAt time.Time `json:"last_opened_at" tab:"-"` LastConnectionAt time.Time `json:"last_connection_at" tab:"-"` AutoOffThreshold xjson.Duration `json:"auto_off_threshold" tab:"-"` }
Environment describes a Coder environment
type InsertSecretReq ¶
type InsertSecretReq struct { Name string `json:"name"` Value string `json:"value"` Description string `json:"description"` }
InsertSecretReq describes the request body for creating a new secret