Documentation
¶
Index ¶
- Constants
- Variables
- type Bucket
- type BucketResources
- type CPUPool
- type DataSource
- type DataSourceType
- type ImageStore
- type Network
- type NetworkState
- type PhaseDist
- type Resource
- func (res Resource) Add(r Resource) (out Resource)
- func (res Resource) GetPorts() (tcp []int, udp []int)
- func (res Resource) GetTCPPorts() (tcp []int)
- func (res Resource) GetUDPPorts() (udp []int)
- func (res Resource) HasTCPPort(port int) bool
- func (res Resource) HasUDPPort(port int) bool
- func (res *Resource) InsertTCPPorts(ports ...int)
- func (res *Resource) InsertUDPPorts(ports ...int)
- func (res Resource) NoTCPPortConflicts(ports ...int) bool
- func (res Resource) NoUDPPortConflicts(ports ...int) bool
- func (res *Resource) RemoveTCPPort(port int)
- func (res *Resource) RemoveTCPPorts(ports ...int)
- func (res *Resource) RemoveUDPPort(port int)
- func (res *Resource) RemoveUDPPorts(ports ...int)
- func (res *Resource) UpdateResources(newRes Resource)
- type ResourceBuckets
- type ResourceDist
- func (rd *ResourceDist) Add(buckets []Bucket)
- func (rd ResourceDist) GetPhase(index int) (PhaseDist, error)
- func (rd ResourceDist) ResourceUsage() Resource
- func (rd ResourceDist) Size() int
- func (rd ResourceDist) ToBiomeCommand(provider biome.CloudProvider, labels map[string]string, defID string, ...) biome.CreateBiome
- type Segment
- type Service
- type ServiceDiff
- type State
- type StatePack
- type SystemDiff
- type TestCommands
Constants ¶
View Source
const ( IPv4Len uint = 32 ReservedIPs uint32 = 2 //5 )
Variables ¶
View Source
var ( ErrNoMoreGlobalNetworks = errors.New("no more global networks") ErrNoMoreLocalNetworks = errors.New("no more local networks") )
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
type Bucket struct {
BucketResources //The real size it occupies
// contains filtered or unexported fields
}
func (Bucket) CalculateInstanceExtras ¶
func (b Bucket) CalculateInstanceExtras() (disks []biome.SourceDisk, cmds [][]string)
func (Bucket) FindByName ¶
func (Bucket) GetSegments ¶
func (Bucket) ListContentName ¶
type BucketResources ¶
type BucketResources struct {
Resource
DataSources map[string]*DataSource //destination
}
func (BucketResources) AddSources ¶
func (res BucketResources) AddSources(sources []DataSource) BucketResources
type CPUPool ¶
type CPUPool struct {
// contains filtered or unexported fields
}
func NewCPUPool ¶
func (*CPUPool) ReleaseCores ¶
type DataSource ¶
type DataSource struct {
Name string `json:"name,omitempty"`
Source string `json:"source,omitempty"`
Destinations []string `json:"destinations"`
Type DataSourceType `json:"type,omitempty"`
}
func (DataSource) Clone ¶
func (ds DataSource) Clone() (out DataSource)
type DataSourceType ¶
type DataSourceType string
const ( GCSSource DataSourceType = "gcs" CloudDiskSource DataSourceType = "cloud-disk" )
type ImageStore ¶
type ImageStore struct {
// contains filtered or unexported fields
}
type Network ¶
func NewNetwork ¶
type NetworkState ¶
type NetworkState interface {
GetNextGlobal() (Network, error)
GetNextLocal(instance int) (Network, error)
}
func NewNetworkState ¶
func NewNetworkState(globalCIDR string, localCIDR string, maxNodes int) (NetworkState, error)
type PhaseDist ¶
type PhaseDist []Bucket
func (PhaseDist) FindBucket ¶
func (PhaseDist) ShowSimpleDist ¶
type Resource ¶
type Resource struct {
CPUs int64
Memory int64 // Memory MB
Storage int64 // Storage MB
TCPPorts map[int]bool
UDPPorts map[int]bool
DataSources []DataSource
}
func (Resource) GetTCPPorts ¶
func (Resource) GetUDPPorts ¶
func (Resource) HasTCPPort ¶
func (Resource) HasUDPPort ¶
func (*Resource) InsertTCPPorts ¶
func (*Resource) InsertUDPPorts ¶
func (Resource) NoTCPPortConflicts ¶
func (Resource) NoUDPPortConflicts ¶
func (*Resource) RemoveTCPPort ¶
func (*Resource) RemoveTCPPorts ¶
func (*Resource) RemoveUDPPort ¶
func (*Resource) RemoveUDPPorts ¶
func (*Resource) UpdateResources ¶
type ResourceBuckets ¶
type ResourceBuckets interface {
Add(segments []Segment) error
Remove(segments []Segment) error
Resources() []Bucket
}
func NewResourceBuckets ¶
func NewResourceBuckets(conf config.Bucket, settings schema.Settings, log logrus.Ext1FieldLogger) ResourceBuckets
type ResourceDist ¶
type ResourceDist []PhaseDist
func (*ResourceDist) Add ¶
func (rd *ResourceDist) Add(buckets []Bucket)
func (ResourceDist) ResourceUsage ¶
func (rd ResourceDist) ResourceUsage() Resource
func (ResourceDist) Size ¶
func (rd ResourceDist) Size() int
func (ResourceDist) ToBiomeCommand ¶
func (rd ResourceDist) ToBiomeCommand(provider biome.CloudProvider, labels map[string]string, defID string, orgID string, testID string, domain string) biome.CreateBiome
type Service ¶
type Service struct {
Name string
Index int
Bucket int64
SquashedService schema.Service
Networks []schema.Network
Sidecars []schema.Sidecar
Labels map[string]string
TCPPorts map[int]int
UDPPorts map[int]int
Timeout command.Timeout
IsTask bool
IgnoreExitCode bool
HostMounts map[string]string
}
func GetDefaultService ¶
func (Service) CalculateDiff ¶
func (serv Service) CalculateDiff(serv2 Service) ServiceDiff
type ServiceDiff ¶
type State ¶
type State struct {
Tasks []Service
SystemState map[string]schema.SystemComponent
Subnets map[string]Network
Network NetworkState
IPs map[string]string
}
func NewState ¶
func NewState(net NetworkState) *State
type StatePack ¶
type StatePack struct {
State
Buckets ResourceBuckets
PrevTasks []Segment
Spec schema.RootSchema
}
func NewStatePack ¶
func NewStatePack(spec schema.RootSchema, conf config.Bucket, settings schema.Settings, logger logrus.Ext1FieldLogger) *StatePack
type SystemDiff ¶
type SystemDiff struct {
Modified []ServiceDiff
AddedNetworks []schema.Network
RemovedNetworks []schema.Network
Added []Service
Removed []Service
}
func (*SystemDiff) Append ¶
func (diff *SystemDiff) Append(sys *SystemDiff)
type TestCommands ¶
func (TestCommands) Append ¶
func (cmds TestCommands) Append(commands [][]command.Command) TestCommands
func (TestCommands) MetaInject ¶
func (cmds TestCommands) MetaInject(kv ...string)
Click to show internal directories.
Click to hide internal directories.