podcast

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// DefaultServiceEndpoint is the service URL
	DefaultServiceEndpoint = "https://api.podops.dev"
	// DefaultNamespacePrefix is the API's namespace
	DefaultNamespacePrefix = "/a/v1"
)

Variables

This section is empty.

Functions

This section is empty.

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(ctx context.Context, 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(ctx context.Context, 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) (string, error)

Build invokes the BuildEndpoint

func (*Client) Close

func (cl *Client) Close()

Close does whatever kind of clean-up is necessary

func (*Client) CreateProduction

func (cl *Client) CreateProduction(name, title, summary string) (*t.ProductionResponse, error)

CreateProduction invokes the CreateProductionEndpoint

func (*Client) CreateResource

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

CreateResource invokes the ResourceEndpoint

func (*Client) Get

func (cl *Client) Get(cmd string, response interface{}) (int, error)

Get is used to request data from the API. No payload, only queries!

func (*Client) IsAuthorized

func (cl *Client) IsAuthorized() bool

IsAuthorized does a quick verification

func (*Client) List

func (cl *Client) List() (*t.ProductionsResponse, error)

List retrieves a list of resources

func (*Client) Post

func (cl *Client) Post(cmd string, request, response interface{}) (int, error)

Post is used to invoke an API method using http POST

func (*Client) Put

func (cl *Client) Put(cmd string, request, response interface{}) (int, error)

Put is used to invoke an API method using http PUT

func (*Client) Store

func (cl *Client) Store(path string)

Store persists the Client state

func (*Client) UpdateResource

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

UpdateResource invokes the ResourceEndpoint

func (*Client) Valid

func (cl *Client) Valid() error

Valid verifies that remote commands can be executed

func (*Client) Validate

func (cl *Client) Validate() error

Validate verifies the token against the backend service

Jump to

Keyboard shortcuts

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