cloud

package
v0.6.16 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: MPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoAuthorizedPublicKeys = errors.New("no authorized public keys found")

ErrNoAuthorizedPublicKeys occurs when no authorized public keys are found

View Source
var ErrNoSSHAgent = errors.Errorf("no ssh auth agent socket")

ErrNoSSHAgent occurs when no ssh auth agent exists

View Source
var ErrUnauthorized = errors.New("unauthorized")

ErrUnauthorized occurs when a user is unauthorized to access a resource

Functions

func IsValidEmail

func IsValidEmail(email string) bool

IsValidEmail returns true if email is valid

Types

type Client

type Client interface {
	RegisterEmail(email string) error
	CreateAccount(email, verificationToken, password, publicKey string, termsConditionsPrivacy bool) error
	Authenticate() error
	Get(path string) ([]byte, error)
	Remove(path string) error
	Set(path string, data []byte) error
	List(path string) ([]string, error)
	GetPublicKeys() ([]*agent.Key, error)
	CreateOrg(org string) error
	Invite(org, user string, write bool) error
	ListOrgs() ([]*OrgDetail, error)
	ListOrgPermissions(path string) ([]*OrgPermissions, error)
	RevokePermission(path, user string) error
	ListPublicKeys() ([]string, error)
	AddPublickKey(string) error
	RemovePublickKey(string) error
	CreateToken(string, bool, *time.Time) (string, error)
	ListTokens() ([]*TokenDetail, error)
	RemoveToken(string) error
	WhoAmI() (string, string, bool, error)
	UploadLog(pathOnDisk string) (string, error)
	SetPasswordCredentials(string, string) error
	SetTokenCredentials(token string) (string, error)
	SetSSHCredentials(email, sshKey string) error
	FindSSHCredentials(emailToFind string) error
	DeleteAuthCache() error
	DeleteCachedToken() error
	DisableSSHKeyGuessing()
	SetAuthTokenDir(path string)
	SendAnalytics(data *EarthlyAnalytics) error
	IsLoggedIn() bool
	GetAuthToken() (string, error)
	LaunchSatellite(name, org string) (*SatelliteInstance, error)
	GetOrgID(name string) (string, error)
	ListSatellites(orgID string) ([]SatelliteInstance, error)
	GetSatellite(name, orgID string) (*SatelliteInstance, error)
	DeleteSatellite(name, orgID string) error
}

Client provides a client to the shared secrets service

func NewClient

func NewClient(host, agentSockPath, authCredsOverride string, warnFunc func(string, ...interface{})) (Client, error)

NewClient provides a new Earthly Cloud client

type EarthlyAnalytics

type EarthlyAnalytics struct {
	Key              string                    `json:"key"`
	InstallID        string                    `json:"install_id"`
	Version          string                    `json:"version"`
	Platform         string                    `json:"platform"`
	GitSHA           string                    `json:"git_sha"`
	ExitCode         int                       `json:"exit_code"`
	CI               string                    `json:"ci_name"`
	RepoHash         string                    `json:"repo_hash"`
	ExecutionSeconds float64                   `json:"execution_seconds"`
	Terminal         bool                      `json:"terminal"`
	Counts           map[string]map[string]int `json:"counts"`
}

EarthlyAnalytics is the payload used in SendAnalytics. It contains information about the command that was run, the environment it was run in, and the result of the command.

type OrgDetail

type OrgDetail struct {
	ID    string
	Name  string
	Admin bool
}

OrgDetail contains an organization and details

type OrgPermissions

type OrgPermissions struct {
	User  string
	Path  string
	Write bool
}

OrgPermissions contains permission details within an org

type SatelliteInstance added in v0.6.16

type SatelliteInstance struct {
	Name     string
	Org      string
	Status   string
	Version  string
	Platform string
}

SatelliteInstance contains details about a remote Buildkit instance.

type TokenDetail

type TokenDetail struct {
	Name   string
	Write  bool
	Expiry time.Time
}

TokenDetail contains token information

Jump to

Keyboard shortcuts

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