api

package
v0.0.0-...-a288e68 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultHTTPTimeout   = "5s"
	DefaultSchedulerHost = "api." + pkg.DefaultServiceName + ".marathon.l4lb.thisdcos.directory"
	ErrEmptyBody         = errors.New("got empty body")
	ErrNonSuccessCode    = errors.New("got non-success code")
)
View Source
var SDKAPIVersion = "v1"

SDKAPIVersion is the version of the DC/OS SDK API

View Source
var SDKClientName = "dcos"

SDKClientName is the name of the DC/OS SDK API client

Functions

This section is empty.

Types

type Client

type Client interface {
	Name() string
	URL() string
	Pods() ([]string, error)
	GetTasks(podName string) ([]pod.Task, error)
	Endpoints() ([]string, error)
	GetEndpoint(endpointName string) (*Endpoint, error)
}

Client is an interface describing a DC/OS SDK API Client

type Config

type Config struct {
	Host    string
	Timeout time.Duration
	Secure  bool
}

Config is a struct of configuration options for the API

type Endpoint

type Endpoint struct {
	Address []string `json:"address"`
	Dns     []string `json:"dns"`
}

Endpoint represents a DC/OS SDK Service endpoint

func (*Endpoint) Addresses

func (e *Endpoint) Addresses() []string

Addresses returns a list of IP:Port addresses for the DC/OS SDK Service endpoint

func (*Endpoint) Hosts

func (e *Endpoint) Hosts() []string

Hosts returns a list of DNS:Port addresses for the DC/OS SDK Service endpoint

type Endpoints

type Endpoints []string

Endpoints contains several DC/OS SDK Service endpoints

type HTTPScheme

type HTTPScheme string

HTTPScheme is the scheme type to be used for HTTP calls

const (
	HTTPSchemePlain  HTTPScheme = "http://"
	HTTPSchemeSecure HTTPScheme = "https://"
)

func (HTTPScheme) String

func (s HTTPScheme) String() string

String returns a string representation of the HTTPScheme

type SDKClient

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

SDKClient is an HTTP client for the DC/OS SDK API

func New

func New(config *Config) *SDKClient

New creates a new SDKClient struct configured for use with the DC/OS SDK API

func (*SDKClient) Endpoints

func (c *SDKClient) Endpoints() ([]string, error)

GetEndpoints returns a slice of DC/OS SDK Service Endpoints

func (*SDKClient) GetEndpoint

func (c *SDKClient) GetEndpoint(endpointName string) (*Endpoint, error)

GetEndpoint returns an DC/OS SDK Service Endpoint by name

func (*SDKClient) GetTasks

func (c *SDKClient) GetTasks(podName string) ([]pod.Task, error)

GetTasks returns a slice of PodTask for a given DC/OS SDK Pod by name

func (*SDKClient) Name

func (c *SDKClient) Name() string

func (*SDKClient) Pods

func (c *SDKClient) Pods() ([]string, error)

Pods returns a slice of existing Pods in the DC/OS SDK

func (*SDKClient) URL

func (c *SDKClient) URL() string

GetPodURL returns a string representing the full HTTP URI to the 'GET /<version>/pod' API call

Directories

Path Synopsis
Code generated by mockery v1.0.0.
Code generated by mockery v1.0.0.

Jump to

Keyboard shortcuts

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