podops

package module
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2021 License: MIT Imports: 13 Imported by: 1

README

PodOps - Podcast Operations

PodOps client and CLI

Documentation

Index

Constants

View Source
const (
	// DefaultNamespacePrefix is the API's namespace
	DefaultNamespacePrefix = "/a/v1"
	// DefaultAPIEndpoint is the podops services's default endpoint
	DefaultAPIEndpoint = "https://api.podops.dev"
)

Variables

This section is empty.

Functions

func DefaultConfigLocation

func DefaultConfigLocation() string

DefaultConfigLocation returns the suggested default location for the config file

Types

type Client

type Client struct {
	ServiceEndpoint string `json:"url" binding:"required"`
	Token           string `json:"token" binding:"required"`
	GUID            string `json:"guid" binding:"required"`
	// contains filtered or unexported fields
}

Client is a client for interacting with the PodOps service.

Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines.

func NewClient

func NewClient(token string) (*Client, error)

NewClient creates a new podcast client.

Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines.

func NewClientFromFile

func NewClientFromFile(path string) (*Client, error)

NewClientFromFile creates a client by reading values from a file

Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines.

func (*Client) Build

func (cl *Client) Build(guid string) (*a.Build, error)

Build invokes the BuildEndpoint

func (*Client) CreateProduction

func (cl *Client) CreateProduction(name, title, summary string) (*a.Production, error)

CreateProduction invokes the CreateProductionEndpoint

func (*Client) CreateResource

func (cl *Client) CreateResource(kind, rsrcGUID string, force bool, rsrc interface{}) (int, error)

CreateResource invokes the ResourceEndpoint

func (*Client) CreateToken

func (cl *Client) CreateToken(secret, realm, clientID, userID, scope string, duration int64) (string, error)

CreateToken creates an access token on the service FIXME this is not tested

func (*Client) Delete

func (cl *Client) Delete(prod, kind, guid string) (int, error)

Delete deletes a resources

func (*Client) HasToken

func (cl *Client) HasToken() error

HasToken verifies that remote commands can be executed

func (*Client) HasTokenAndGUID

func (cl *Client) HasTokenAndGUID() error

HasTokenAndGUID verifies the presence of a token and GUID

func (*Client) Productions

func (cl *Client) Productions() (*a.ProductionList, error)

Productions retrieves a list of productions

func (*Client) Resource

func (cl *Client) Resource(prod, kind, guid string, rsrc interface{}) error

Resource returns a resource file

func (*Client) Resources

func (cl *Client) Resources(prod, kind string) (*a.ResourceList, error)

Resources retrieves a list of resources

func (*Client) SetProduction

func (cl *Client) SetProduction(guid string)

SetProduction sets the context of further operations

func (*Client) Store

func (cl *Client) Store(path string) error

Store persists the Client state

func (*Client) UpdateResource

func (cl *Client) UpdateResource(kind, rsrcGUID string, force bool, rsrc interface{}) (int, error)

UpdateResource invokes the ResourceEndpoint

func (*Client) Upload

func (cl *Client) Upload(path string, force bool) error

Upload invokes the UploadEndpoint

func (*Client) Validate

func (cl *Client) Validate() error

Validate verifies the token against the backend service

Directories

Path Synopsis
cmd
cli command
token command

Jump to

Keyboard shortcuts

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