config

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2017 License: MIT Imports: 12 Imported by: 12

Documentation

Index

Constants

View Source
const (
	OperatorAPIPath  = "/api/v1"
	SchedulerAPIPath = "/api/v1/scheduler"
)

Variables

This section is empty.

Functions

func HomeDir

func HomeDir() string

Types

type CommandOpts

type CommandOpts struct {
	Shell bool
	User  string
	Value string
	Envs  []mesos.Environment_Variable
}

type Config

type Config struct {
	Profiles map[string]*Profile `json:"profiles"`
}

type ContainerOpts

type ContainerOpts struct {
	Docker bool
	//Image  *mesos.Image
	Image string
	// Docker specific opts
	Privileged     bool
	ForcePullImage bool
	NetworkMode    mesos.ContainerInfo_DockerInfo_Network
	Volumes        []mesos.Volume
	Parameters     []mesos.Parameter
	PortMappings   []mesos.ContainerInfo_DockerInfo_PortMapping
}

type Option

type Option func(*Profile)

Options are functional profile options

func Command

func Command(opts CommandOpts) Option

Command sets Mesos CommandInfo options

func Container

func Container(opts ContainerOpts) Option

func Debug

func Debug(debug bool) Option

func Master

func Master(master string) Option

Master specifies the Mesos master hostname

func Restart

func Restart(restart bool) Option

func TaskInfo

func TaskInfo(info *mesos.TaskInfo) Option

type Profile

type Profile struct {
	Master   string          `json:"master"`
	TaskInfo *mesos.TaskInfo `json:"-"`
	Debug    bool            `json:"debug"`
	Restart  bool            `json:"restart"`
	// contains filtered or unexported fields
}

Profile contains environment specific options

func LoadProfile

func LoadProfile(path, name string) (profile *Profile, err error)

LoadProfile loads a user configuration from ~/.mesos-cli.json creating a JSON file with defaults if it does not exist.

func (Profile) Endpoint

func (p Profile) Endpoint() *url.URL

func (Profile) Framework

func (p Profile) Framework() *mesos.FrameworkInfo

func (*Profile) Log

func (p *Profile) Log() *zap.Logger

func (Profile) Scheduler

func (p Profile) Scheduler() *url.URL

func (Profile) Task

func (p Profile) Task() *mesos.TaskInfo

func (*Profile) With

func (p *Profile) With(opts ...Option) *Profile

Jump to

Keyboard shortcuts

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