types

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2018 License: GPL-3.0 Imports: 3 Imported by: 19

Documentation

Overview

Types package includes all the structures shared between the caravela's server/daemon and its clients.

Index

Constants

This section is empty.

Variables

View Source
var (
	RequestIDKey = requestCtxKey("ID")
)

Functions

func RequestID added in v0.3.0

func RequestID(ctx context.Context) string

RequestID creates a new request ID key for a context.

Types

type AvailableOffer

type AvailableOffer struct {
	Offer      `json:"Offer"`
	SupplierIP string `json:"SupplierIP"`
}

type CPUPower added in v0.2.0

type CPUPower uint
const (
	LowCPUPower CPUPower = iota
	MediumCPUPower
	HighCPUPower
)

func (CPUPower) String added in v0.2.0

func (cp CPUPower) String() string

func (*CPUPower) ValueOf added in v0.2.0

func (cp *CPUPower) ValueOf(arg string) error

type ContainerConfig

type ContainerConfig struct {
	Name         string        `json:"Name"`
	ImageKey     string        `json:"ImageKey"`
	Args         []string      `json:"Args"`
	PortMappings []PortMapping `json:"PortMappings"`
	Resources    Resources     `json:"Resources"`
	GroupPolicy  GroupPolicy   `json:"GroupPolicy"`
}

type ContainerStatus

type ContainerStatus struct {
	ContainerConfig `json:"ContainerConfig"`
	SupplierIP      string `json:"SupplierIP"`
	ContainerID     string `json:"ContainerID"`
	Status          string `json:"Status"`
}

type GroupPolicy added in v0.2.0

type GroupPolicy uint
const (
	SpreadGroupPolicy GroupPolicy = iota
	CoLocationGroupPolicy
)

func (GroupPolicy) String added in v0.2.0

func (gp GroupPolicy) String() string

func (*GroupPolicy) ValueOf added in v0.2.0

func (gp *GroupPolicy) ValueOf(arg string) error

type Node

type Node struct {
	IP   string `json:"IP"`
	GUID string `json:"GUID"`
}

type Offer

type Offer struct {
	ID        int64     `json:"ID"`
	Amount    int       `json:"Amount"`
	Resources Resources `json:"Resources"`
}

type PortMapping

type PortMapping struct {
	HostPort      int `json:"HostPort"`
	ContainerPort int `json:"ContainerPort"`
}

type Resources

type Resources struct {
	CPUPower CPUPower `json:"CPUPower"`
	CPUs     int      `json:"CPUs"`
	RAM      int      `json:"RAM"`
}

Jump to

Keyboard shortcuts

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