client

package
v0.0.0-...-72504b9 Latest Latest
Warning

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

Go to latest
Published: May 30, 2019 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const EnvProviderName = "EnvConfigCredentials"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

The main api client

func Must

func Must(c *Client, err error) *Client

func New

func New(cfgs ...*checkpoint.Config) (*Client, error)

Create a new client from a list of config objects

func (*Client) EnsureSession

func (c *Client) EnsureSession() error

Re-new the session if needed

func (*Client) Logout

func (c *Client) Logout() (*request.MessageResponse, error)

Logout the user. Do not check the session.

func (*Client) Publish

func (c *Client) Publish() (*PublishResponse, error)

Publish changes

func (*Client) ResetSession

func (c *Client) ResetSession()

Reset a session and ensure that the session will not be reused

func (*Client) Send

func (c *Client) Send(req *request.Request, res interface{}) error

Ensures that the session is valid and sends the request

type DefaultRetryer

type DefaultRetryer struct {
	NumMaxRetries int
}

DefaultRetryer implements basic retry logic using exponential backoff for most services.

func (DefaultRetryer) MaxRetries

func (d DefaultRetryer) MaxRetries() int

MaxRetries returns the number of maximum returns the service will use to make an individual API request.

func (DefaultRetryer) RetryRules

func (d DefaultRetryer) RetryRules(r *request.Request) time.Duration

RetryRules returns the delay duration before retrying this request again

func (DefaultRetryer) ShouldRetry

func (d DefaultRetryer) ShouldRetry(r *request.Request) bool

ShouldRetry returns true if the request should be retried.

type LastLoginResponse

type LastLoginResponse struct {
	Posix int64  `json:"posix"`
	Iso   string `json:"iso-8601"`
}

type LoginInput

type LoginInput struct {
	User                string `json:"user"`
	Password            string `json:"password"`
	SessionName         string `json:"session-name"`
	SessionTimeout      int64  `json:"session-timeout"`
	ContinueLastSession bool   `json:"continue-last-session"`
}

Describes the input parameters for the login request

type LoginResponse

type LoginResponse struct {
	Uid       string             `json:"uid"`
	Sid       string             `json:"sid"`
	Url       string             `json:"url"`
	ExpiresIn int64              `json:"session-timeout"`
	LastLogin *LastLoginResponse `json:"last-login-was-at"`
	Version   string             `json:"api-server-version"`
}

Describes the response parameters returned by a login request

type LogoutInput

type LogoutInput struct{}

Describes the input parameters for the logout request

type PublishInput

type PublishInput struct{}

Describes the input parameters for the publish request

type PublishResponse

type PublishResponse struct {
	TaskId string `json:"task-id"`
}

Describes the response parameters returned by a publish request

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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