Documentation ¶
Index ¶
- Constants
- Variables
- func AddCocoon(email string, cocoon *types.Cocoon) error
- func AddSignatories(cocoonID string, ids []string) error
- func AddVote(id string, vote int, isCocoonID bool) error
- func CreateCocoon(cocoonPayload *proto_api.ContractRequest) error
- func CreateIdentity(email string) error
- func FirewallAllow(dest, port, protocol string) error
- func GetAPIConnection() (*grpc.ClientConn, error)
- func GetCocoons(ids []string) error
- func GetDefaultDB() *bolt.DB
- func GetFirstByPrefix(db *bolt.DB, bucket, prefix string) ([]byte, []byte, error)
- func GetLogs(cocoonID string, numLines int, tail, stderrOnly, stdoutOnly, disableColor bool) error
- func GetReleases(ids []string) error
- func GetUserSessionToken() (*types.UserSession, error)
- func Interceptors() grpc.UnaryClientInterceptor
- func ListCocoons(showAll, jsonFormatted bool) error
- func Login(email, password string) error
- func Logout(allSessions bool) error
- func RemoveSignatories(cocoonID string, ids []string) error
- func Start(ids []string, releaseID string) error
- func StopCocoon(ids []string) error
- func UpdateCocoon(id string, upd *proto_api.ContractRequest) error
Constants ¶
const ContextTimeout = 1 * time.Minute
ContextTimeout is the duration a context can remain active before it is cancelled
Variables ¶
var APIAddress = util.Env("API_ADDRESS", "127.0.0.1:8004")
APIAddress is the remote address to the cluster server
var ( // ErrNoUserSession tells us about the current user not having an active session ErrNoUserSession = fmt.Errorf("user has no active session") )
var MaxBulkObjCount = 25
MaxBulkObjCount determines the number of bulk objects in commands that perform bulk requests
var MinimumLogLines = 10
MinimumLogLines defines the minimum number of lines of logs to return
var ProjectName = "cocoon"
ProjectName is the official name of the project
Functions ¶
func AddSignatories ¶
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 ¶
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 FirewallAllow ¶
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 ¶
GetCocoons fetches one or more cocoons and logs them
func GetDefaultDB ¶
GetDefaultDB returns a handle to the client's database
func GetFirstByPrefix ¶
GetFirstByPrefix returns the first key with the matching prefix
func GetLogs ¶
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 ¶
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 ¶
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 ¶
Login authenticates the client user. It sends the credentials to the platform and returns a JWT token for future requests.
func Logout ¶
Logout destroy the current session. If allSessions is set, all sessions associated with the identity is destroyed.
func RemoveSignatories ¶
RemoveSignatories removes one or more signatories of a cocoon.
func Start ¶
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 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.