client

package
v0.0.0-...-7b2e207 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2018 License: AGPL-3.0, Apache-2.0 Imports: 28 Imported by: 1

Documentation

Index

Constants

View Source
const ContextTimeout = 1 * time.Minute

ContextTimeout is the duration a context can remain active before it is cancelled

Variables

View Source
var APIAddress = util.Env("API_ADDRESS", "127.0.0.1:8004")

APIAddress is the remote address to the cluster server

View Source
var (

	// ErrNoUserSession tells us about the current user not having an active session
	ErrNoUserSession = fmt.Errorf("user has no active session")
)
View Source
var MaxBulkObjCount = 25

MaxBulkObjCount determines the number of bulk objects in commands that perform bulk requests

View Source
var MinimumLogLines = 10

MinimumLogLines defines the minimum number of lines of logs to return

View Source
var ProjectName = "cocoon"

ProjectName is the official name of the project

Functions

func AddCocoon

func AddCocoon(email string, cocoon *types.Cocoon) error

AddCocoon adds a cocoon to an identities collection

func AddSignatories

func AddSignatories(cocoonID string, ids []string) error

AddSignatories adds one or more valid identities to a cocoon's signatory list. All valid identities are included and invalid ones will produce an error log..

func AddVote

func AddVote(id string, vote int, isCocoonID bool) error

AddVote adds a new vote to a release. If isCocoonID is true, the id is taken to be a cocoon id and as such the vote is added to the latest release. A positive vote is denoted with 1 or 0 for negative.

func CreateCocoon

func CreateCocoon(cocoonPayload *proto_api.ContractRequest) error

CreateCocoon a new cocoon

func CreateIdentity

func CreateIdentity(email string) error

CreateIdentity creates a new identity

func FirewallAllow

func FirewallAllow(dest, port, protocol string) error

FirewallAllow adds a firewall rule to allow connection to an outgoing destination

func GetAPIConnection

func GetAPIConnection() (*grpc.ClientConn, error)

GetAPIConnection returns a connection to the platform API. It injects the users session into the connector.

func GetCocoons

func GetCocoons(ids []string) error

GetCocoons fetches one or more cocoons and logs them

func GetDefaultDB

func GetDefaultDB() *bolt.DB

GetDefaultDB returns a handle to the client's database

func GetFirstByPrefix

func GetFirstByPrefix(db *bolt.DB, bucket, prefix string) ([]byte, []byte, error)

GetFirstByPrefix returns the first key with the matching prefix

func GetLogs

func GetLogs(cocoonID string, numLines int, tail, stderrOnly, stdoutOnly, disableColor bool) error

GetLogs displays the logs of a cocoon. Supports number of line limitation via the numLines parameter. Continuous streaming of logs if tail is true and filter by stderr or stdout. By default stderr and stdout are returned.

func GetReleases

func GetReleases(ids []string) error

GetReleases fetches one or more releases and logs them

func GetUserSessionToken

func GetUserSessionToken() (*types.UserSession, error)

GetUserSessionToken returns the user session

func Interceptors

func Interceptors() grpc.UnaryClientInterceptor

Interceptors return the interceptors to run before API calls

func ListCocoons

func ListCocoons(showAll, jsonFormatted bool) error

ListCocoons fetches and displays running cocoons belonging to the logged in user. Set showAll to true to list both running and stopped cocoons.

func Login

func Login(email, password string) error

Login authenticates the client user. It sends the credentials to the platform and returns a JWT token for future requests.

func Logout

func Logout(allSessions bool) error

Logout destroy the current session. If allSessions is set, all sessions associated with the identity is destroyed.

func RemoveSignatories

func RemoveSignatories(cocoonID string, ids []string) error

RemoveSignatories removes one or more signatories of a cocoon.

func Start

func Start(ids []string, releaseID string) error

Start starts one or more new or stopped cocoon code. If releaseID is set, the release is executed as opposed to the latest release being executed

func StopCocoon

func StopCocoon(ids []string) error

StopCocoon one or more running cocoon codes

func UpdateCocoon

func UpdateCocoon(id string, upd *proto_api.ContractRequest) error

UpdateCocoon updates a cocoon and optionally creates a new release. A new release is created when Release fields are set/defined. No release is created if updated release fields match existing fields.

Types

This section is empty.

Jump to

Keyboard shortcuts

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