api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateLeaseReq

type CreateLeaseReq struct {
	MaxTimeSec     int    `json:"max_time"`
	ClusterRegex   string `json:"cluster_regex"`
	ClusterVersion string `json:"cluster_version"`
}

CreateLeaseReq is the encoding/json compatible struct that represents the POST /lease request body

func (CreateLeaseReq) ExpirationTime

func (c CreateLeaseReq) ExpirationTime(start time.Time) time.Time

ExpirationTime is a convenience function for start.Add(c.MaxTimeDur())

func (CreateLeaseReq) MaxTimeDur

func (c CreateLeaseReq) MaxTimeDur() time.Duration

MaxTimeDur returns the maximum time specified in c as a time.Duration

type CreateLeaseResp

type CreateLeaseResp struct {
	KubeConfigStr  string `json:"kubeconfig"`
	IP             string `json:"ip"`
	Token          string `json:"uuid"`
	ClusterName    string `json:"cluster_name"`
	ClusterVersion string `json:"cluster_version"`
}

CreateLeaseResp is the encoding/json compatible struct that represents the POST /lease response body

func DecodeCreateLeaseResp

func DecodeCreateLeaseResp(rdr io.Reader) (*CreateLeaseResp, error)

DecodeCreateLeaseResp decodes rdr from its JSON representation into a CreateLeaseResp. If there was any error reading rdr or it had malformed JSON, returns nil and the error

func (CreateLeaseResp) KubeConfig

func (c CreateLeaseResp) KubeConfig() (*k8s.KubeConfig, error)

KubeConfig returns decoded and unmarshalled Kubernetes client configuration

func (CreateLeaseResp) KubeConfigBytes

func (c CreateLeaseResp) KubeConfigBytes() ([]byte, error)

KubeConfigBytes decodes c.KubeConfig by the RFC 4648 standard. See http://tools.ietf.org/html/rfc4648 for more information

Jump to

Keyboard shortcuts

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