portainer

package
v0.0.0-...-147c068 Latest Latest
Warning

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

Go to latest
Published: May 15, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPortainerError

func CheckPortainerError(err error) (int, error)

CheckPortainerError check for common error like server error or authentication failed. It returns 0 when the error is handled or the http error code otherwise

func EndpointLookup

func EndpointLookup(cli *portainerapi.Portainer, name string) (*portainertype.Endpoint, error)

EndpointLookup look up for the endpoint based on the name and returns the Id

func GetDockerEndpoint

func GetDockerEndpoint(path string, id int64) string

GetDockerEndpoint returns the docker endpoint for a given portainer endpoint id

func StackLookup

func StackLookup(cli *portainerapi.Portainer, swarmID, name string) (*portainertype.Stack, error)

StackLookup returns the stack with the name provided for the specified endpoint

func SwarmLookup

func SwarmLookup(cli *dockerapi.DockerEngine) (*models.Swarm, error)

SwarmLookup look up for the swarm information of the given engine

Types

type AuthContext

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

AuthContext is the configuration and authentication cache

func NewAuthContext

func NewAuthContext() *AuthContext

NewAuthContext returns the portainer context loading authentication tokens from a file

func (*AuthContext) GetToken

func (c *AuthContext) GetToken(host string) (runtime.ClientAuthInfoWriter, error)

GetToken return the current token associated with an host

func (*AuthContext) SaveContext

func (c *AuthContext) SaveContext() error

SaveContext writes all the current tokens in a file

func (*AuthContext) SetToken

func (c *AuthContext) SetToken(host, mode, token string)

SetToken sets the current token associated with an host

Jump to

Keyboard shortcuts

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