account

package
v1.8.5 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2020 License: MPL-2.0 Imports: 8 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID               string    `json:"id"`
	Login            string    `json:"login"`
	Email            string    `json:"email"`
	CompanyName      string    `json:"companyName"`
	FirstName        string    `json:"firstName"`
	LastName         string    `json:"lastName"`
	Address          string    `json:"address"`
	PostalCode       string    `json:"postalCode"`
	City             string    `json:"city"`
	State            string    `json:"state"`
	Country          string    `json:"country"`
	Phone            string    `json:"phone"`
	Created          time.Time `json:"created"`
	Updated          time.Time `json:"updated"`
	TritonCNSEnabled bool      `json:"triton_cns_enabled"`
}

type AccountClient

type AccountClient struct {
	Client *client.Client
}

func NewClient

func NewClient(config *triton.ClientConfig) (*AccountClient, error)

NewClient returns a new client for working with Account endpoints and resources within CloudAPI

func (*AccountClient) Config

func (c *AccountClient) Config() *ConfigClient

Config returns a c used for accessing functions pertaining to Config functionality in the Triton API.

func (AccountClient) Get

func (c AccountClient) Get(ctx context.Context, input *GetInput) (*Account, error)

func (*AccountClient) Keys

func (c *AccountClient) Keys() *KeysClient

Keys returns a Compute client used for accessing functions pertaining to SSH key functionality in the Triton API.

func (*AccountClient) SetHeader

func (c *AccountClient) SetHeader(header *http.Header)

SetHeaders allows a consumer of the current client to set custom headers for the next backend HTTP request sent to CloudAPI

func (AccountClient) Update

func (c AccountClient) Update(ctx context.Context, input *UpdateInput) (*Account, error)

UpdateAccount updates your account details with the given parameters. TODO(jen20) Work out a safe way to test this

type Config

type Config struct {
	// DefaultNetwork is the network that docker containers are provisioned on.
	DefaultNetwork string `json:"default_network"`
}

Config represents configuration for your account.

type ConfigClient

type ConfigClient struct {
	// contains filtered or unexported fields
}

func (*ConfigClient) Get

func (c *ConfigClient) Get(ctx context.Context, input *GetConfigInput) (*Config, error)

GetConfig outputs configuration for your account.

func (*ConfigClient) Update

func (c *ConfigClient) Update(ctx context.Context, input *UpdateConfigInput) (*Config, error)

UpdateConfig updates configuration values for your account.

type CreateKeyInput

type CreateKeyInput struct {
	// Name of the key. Optional.
	Name string `json:"name,omitempty"`

	// OpenSSH-formatted public key.
	Key string `json:"key"`
}

CreateKeyInput represents the option that can be specified when creating a new key.

type DeleteKeyInput

type DeleteKeyInput struct {
	KeyName string
}

type GetConfigInput

type GetConfigInput struct{}

type GetInput

type GetInput struct{}

type GetKeyInput

type GetKeyInput struct {
	KeyName string
}

type Key

type Key struct {
	// Name of the key
	Name string `json:"name"`

	// Key fingerprint
	Fingerprint string `json:"fingerprint"`

	// OpenSSH-formatted public key
	Key string `json:"key"`
}

Key represents a public key

type KeysClient

type KeysClient struct {
	// contains filtered or unexported fields
}

func (*KeysClient) Create

func (c *KeysClient) Create(ctx context.Context, input *CreateKeyInput) (*Key, error)

CreateKey uploads a new OpenSSH key to Triton for use in HTTP signing and SSH.

func (*KeysClient) Delete

func (c *KeysClient) Delete(ctx context.Context, input *DeleteKeyInput) error

func (*KeysClient) Get

func (c *KeysClient) Get(ctx context.Context, input *GetKeyInput) (*Key, error)

func (*KeysClient) List

func (c *KeysClient) List(ctx context.Context, _ *ListKeysInput) ([]*Key, error)

ListKeys lists all public keys we have on record for the specified account.

type ListKeysInput

type ListKeysInput struct{}

type UpdateConfigInput

type UpdateConfigInput struct {
	// DefaultNetwork is the network that docker containers are provisioned on.
	DefaultNetwork string `json:"default_network"`
}

type UpdateInput

type UpdateInput struct {
	Email            string `json:"email,omitempty"`
	CompanyName      string `json:"companyName,omitempty"`
	FirstName        string `json:"firstName,omitempty"`
	LastName         string `json:"lastName,omitempty"`
	Address          string `json:"address,omitempty"`
	PostalCode       string `json:"postalCode,omitempty"`
	City             string `json:"city,omitempty"`
	State            string `json:"state,omitempty"`
	Country          string `json:"country,omitempty"`
	Phone            string `json:"phone,omitempty"`
	TritonCNSEnabled bool   `json:"triton_cns_enabled,omitempty"`
}

Jump to

Keyboard shortcuts

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