builders

package
v0.4.1-rc0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessPoint

type AccessPoint struct {
	// NodeID of the access point in the network
	NodeID string `json:"node_id"`
	// Subnet to be routed through this access point
	Subnet      schema.IPRange `json:"subnet"`
	WGPublicKey string         `json:"wg_public_key"`
	IP4         bool           `json:"ip4"`
}

AccessPoint info for a network, defining a node which will act as the AP, and the subnet which will be routed through it

type CapacityReservationBuilder

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

CapacityReservationBuilder is a struct that can build reservations

func LoadCapacityReservationBuilder

func LoadCapacityReservationBuilder(reader io.Reader) (*CapacityReservationBuilder, error)

LoadCapacityReservationBuilder loads a reservation builder based on a file path

func NewCapacityReservationBuilder

func NewCapacityReservationBuilder() *CapacityReservationBuilder

NewCapacityReservationBuilder creates a new CapacityReservationBuilder

func (*CapacityReservationBuilder) Build

Build returns the reservation

func (*CapacityReservationBuilder) Save

func (r *CapacityReservationBuilder) Save(writer io.Writer) error

Save saves the reservation builder to an IO.Writer

func (*CapacityReservationBuilder) WithCUs

WithCUs sets the cus to the reservation

func (*CapacityReservationBuilder) WithCurrencies

func (r *CapacityReservationBuilder) WithCurrencies(currencies []string) *CapacityReservationBuilder

WithCurrencies sets the currencies to the reservation

func (*CapacityReservationBuilder) WithCustomerSignature

func (r *CapacityReservationBuilder) WithCustomerSignature(customerSignature string) *CapacityReservationBuilder

WithCustomerSignature sets the customer signature to the reservation

func (*CapacityReservationBuilder) WithCustomerTID

func (r *CapacityReservationBuilder) WithCustomerTID(customerTid int64) *CapacityReservationBuilder

WithCustomerTID sets the customer signature to the reservation

func (*CapacityReservationBuilder) WithNodeIDs

WithNodeIDs sets the node ids to the reservation

func (*CapacityReservationBuilder) WithPoolID

WithPoolID sets the customer signature to the reservation

func (*CapacityReservationBuilder) WithSUs

WithSUs sets the cus to the reservation

type ContainerBuilder

type ContainerBuilder struct {
	workloads.Container
}

ContainerBuilder is a struct that can build containers

func LoadContainerBuilder

func LoadContainerBuilder(reader io.Reader) (*ContainerBuilder, error)

LoadContainerBuilder loads a container builder based on a file path

func NewContainerBuilder

func NewContainerBuilder(nodeID, flist string, network []workloads.NetworkConnection) *ContainerBuilder

NewContainerBuilder creates a new container builder

func (*ContainerBuilder) Build

func (c *ContainerBuilder) Build() (workloads.Container, error)

Build validates and encrypts the secret environment of the container

func (*ContainerBuilder) Save

func (c *ContainerBuilder) Save(writer io.Writer) error

Save saves the container builder to an IO.Writer

func (*ContainerBuilder) WithContainerCapacity

func (c *ContainerBuilder) WithContainerCapacity(cap workloads.ContainerCapacity) *ContainerBuilder

WithContainerCapacity sets the container capacity to the container

func (*ContainerBuilder) WithEntrypoint

func (c *ContainerBuilder) WithEntrypoint(entrypoint string) *ContainerBuilder

WithEntrypoint sets the entrypoint to the container

func (*ContainerBuilder) WithEnvs

func (c *ContainerBuilder) WithEnvs(envs map[string]string) *ContainerBuilder

WithEnvs sets the environments to the container

func (*ContainerBuilder) WithFlist

func (c *ContainerBuilder) WithFlist(flist string) *ContainerBuilder

WithFlist sets the flist to the container

func (*ContainerBuilder) WithHubURL

func (c *ContainerBuilder) WithHubURL(url string) *ContainerBuilder

WithHubURL sets the hub url to the container

func (*ContainerBuilder) WithInteractive

func (c *ContainerBuilder) WithInteractive(interactive bool) *ContainerBuilder

WithInteractive sets the interactive flag to the container

func (*ContainerBuilder) WithLogs

func (c *ContainerBuilder) WithLogs(logs []workloads.Logs) *ContainerBuilder

WithLogs sets the logs to the container

func (*ContainerBuilder) WithNetwork

func (c *ContainerBuilder) WithNetwork(connections []workloads.NetworkConnection) *ContainerBuilder

WithNetwork sets the networks to the container

func (*ContainerBuilder) WithNodeID

func (c *ContainerBuilder) WithNodeID(nodeID string) *ContainerBuilder

WithNodeID sets the node ID to the container

func (*ContainerBuilder) WithPoolID

func (c *ContainerBuilder) WithPoolID(poolID int64) *ContainerBuilder

WithPoolID sets the poolID to the container

func (*ContainerBuilder) WithSecretEnvs

func (c *ContainerBuilder) WithSecretEnvs(envs map[string]string) *ContainerBuilder

WithSecretEnvs sets the secret environments to the container

func (*ContainerBuilder) WithStats added in v0.4.2

func (c *ContainerBuilder) WithStats(stats []workloads.Stats) *ContainerBuilder

WithStats sets the stats aggregators to the container

func (*ContainerBuilder) WithVolumes

func (c *ContainerBuilder) WithVolumes(mounts []workloads.ContainerMount) *ContainerBuilder

WithVolumes sets the volumes to the container

type K8sBuilder

type K8sBuilder struct {
	workloads.K8S
}

K8sBuilder is a struct that can build K8S's

func LoadK8sBuilder

func LoadK8sBuilder(reader io.Reader) (*K8sBuilder, error)

LoadK8sBuilder loads a k8s builder based on a file path

func NewK8sBuilder

func NewK8sBuilder(nodeID, networkID, secret string, size int64, IP net.IP) *K8sBuilder

NewK8sBuilder creates a new K8S builder

func (*K8sBuilder) Build

func (k8s *K8sBuilder) Build() workloads.K8S

Build returns the kubernetes

func (*K8sBuilder) Save

func (k8s *K8sBuilder) Save(writer io.Writer) error

Save saves the K8S builder to an IO.Writer

func (*K8sBuilder) WithClusterSecret

func (k8s *K8sBuilder) WithClusterSecret(secret string) *K8sBuilder

WithClusterSecret sets the cluster secret to the K8S

func (*K8sBuilder) WithIPAddress

func (k8s *K8sBuilder) WithIPAddress(ip net.IP) *K8sBuilder

WithIPAddress sets the ip address to the K8S

func (*K8sBuilder) WithMasterIPs

func (k8s *K8sBuilder) WithMasterIPs(ips []net.IP) *K8sBuilder

WithMasterIPs sets the master IPs to the K8S

func (*K8sBuilder) WithNetworkID

func (k8s *K8sBuilder) WithNetworkID(id string) *K8sBuilder

WithNetworkID sets the network id to the K8S

func (*K8sBuilder) WithNodeID

func (k8s *K8sBuilder) WithNodeID(nodeID string) *K8sBuilder

WithNodeID sets the node ID to the K8S

func (*K8sBuilder) WithPoolID

func (k8s *K8sBuilder) WithPoolID(poolID int64) *K8sBuilder

WithPoolID sets the poolID to the k8s

func (*K8sBuilder) WithSSHKeys

func (k8s *K8sBuilder) WithSSHKeys(sshKeys []string) *K8sBuilder

WithSSHKeys sets the ssh keys to the K8S

func (*K8sBuilder) WithSize

func (k8s *K8sBuilder) WithSize(size int64) *K8sBuilder

WithSize sets the size to the K8S

func (*K8sBuilder) WithStatsAggregator

func (k8s *K8sBuilder) WithStatsAggregator(aggregators []workloads.StatsAggregator) *K8sBuilder

WithStatsAggregator sets the stats aggregators to the K8S

type NetResource

type NetResource struct {
	workloads.NetworkResource

	// Public endpoints
	PubEndpoints []net.IP `json:"pub_endpoints"`
}

NetResource is the description of a part of a network local to a specific node

type NetworkBuilder

type NetworkBuilder struct {
	Name         string         `json:"name,omitempty"`
	IPRange      schema.IPRange `json:"iprange,omitempty"`
	AccessPoints []AccessPoint  `json:"access_points,omitempty"`
	// NetResources field override
	NetResources []NetResource `json:"net_resources,omitempty"`
	// contains filtered or unexported fields
}

NetworkBuilder is a struct that can build networks

func LoadNetworkBuilder

func LoadNetworkBuilder(reader io.Reader, explorer *client.Client) (*NetworkBuilder, error)

LoadNetworkBuilder loads a network builder based on a file path

func NewNetworkBuilder

func NewNetworkBuilder(name string, iprange schema.IPRange, explorer *client.Client) *NetworkBuilder

NewNetworkBuilder creates a new network builder

func (*NetworkBuilder) AddAccess

func (n *NetworkBuilder) AddAccess(nodeID string, subnet schema.IPRange, wgPubKey string, ip4 bool) (*NetworkBuilder, string, error)

AddAccess adds access to a node in the network the subnet will be routed through the accesspoint of the node

func (*NetworkBuilder) AddNode

func (n *NetworkBuilder) AddNode(nodeID string, subnet string, port uint, forceHidden bool) (*NetworkBuilder, error)

AddNode adds a node to the network the subnet will be added as network resource to the node forceHidden will set no public endpoints to the node

func (*NetworkBuilder) Build

Build returns the network

func (*NetworkBuilder) NetworkGraph

func (n *NetworkBuilder) NetworkGraph(w io.Writer) error

NetworkGraph creates a networkgraph for a network

func (*NetworkBuilder) RemoveNode

func (n *NetworkBuilder) RemoveNode(schema string, nodeID string) error

RemoveNode removes a node

func (*NetworkBuilder) Save

func (n *NetworkBuilder) Save(writer io.Writer) error

Save saves the network builder to an IO.Writer

func (*NetworkBuilder) WithIPRange

func (n *NetworkBuilder) WithIPRange(ipRange schema.IPRange) *NetworkBuilder

WithIPRange sets the ip range to the network

func (*NetworkBuilder) WithName

func (n *NetworkBuilder) WithName(name string) *NetworkBuilder

WithName sets the name to the network

type VolumeBuilder

type VolumeBuilder struct {
	workloads.Volume
}

VolumeBuilder is a struct that can build volumes

func LoadVolumeBuilder

func LoadVolumeBuilder(reader io.Reader) (*VolumeBuilder, error)

LoadVolumeBuilder loads a volume builder based on a file path

func NewVolumeBuilder

func NewVolumeBuilder(nodeID string, size int64, volumeType workloads.VolumeTypeEnum) *VolumeBuilder

NewVolumeBuilder creates a new volume builder

func (*VolumeBuilder) Build

func (v *VolumeBuilder) Build() workloads.Volume

Build returns the volume

func (*VolumeBuilder) Save

func (v *VolumeBuilder) Save(writer io.Writer) error

Save saves the volume builder to an IO.Writer

func (*VolumeBuilder) WithNodeID

func (v *VolumeBuilder) WithNodeID(nodeID string) *VolumeBuilder

WithNodeID sets the node ID to the volume

func (*VolumeBuilder) WithPoolID

func (v *VolumeBuilder) WithPoolID(poolID int64) *VolumeBuilder

WithPoolID sets the poolID to the volume

func (*VolumeBuilder) WithSize

func (v *VolumeBuilder) WithSize(size int64) *VolumeBuilder

WithSize sets the volume size

func (*VolumeBuilder) WithType

func (v *VolumeBuilder) WithType(diskType workloads.VolumeTypeEnum) *VolumeBuilder

WithType sets the volume type

type ZDBBuilder

type ZDBBuilder struct {
	workloads.ZDB
}

ZDBBuilder is a struct that can build ZDB's

func LoadZdbBuilder

func LoadZdbBuilder(reader io.Reader) (*ZDBBuilder, error)

LoadZdbBuilder loads a zdb builder based on a file path

func NewZdbBuilder

func NewZdbBuilder(nodeID string, size int64, mode workloads.ZDBModeEnum, diskType workloads.DiskTypeEnum) *ZDBBuilder

NewZdbBuilder creates a new zdb builder and initializes some default values

func (*ZDBBuilder) Build

func (z *ZDBBuilder) Build() (workloads.ZDB, error)

Build validates and encrypts the zdb secret

func (*ZDBBuilder) Save

func (z *ZDBBuilder) Save(writer io.Writer) error

Save saves the zdb builder to an IO.Writer

func (*ZDBBuilder) WithDiskType

func (z *ZDBBuilder) WithDiskType(diskType workloads.DiskTypeEnum) *ZDBBuilder

WithDiskType sets the disktype to the zdb

func (*ZDBBuilder) WithMode

func (z *ZDBBuilder) WithMode(mode workloads.ZDBModeEnum) *ZDBBuilder

WithMode sets the mode to the zdb

func (*ZDBBuilder) WithNodeID

func (z *ZDBBuilder) WithNodeID(nodeID string) *ZDBBuilder

WithNodeID sets the node ID to the zdb

func (*ZDBBuilder) WithPassword

func (z *ZDBBuilder) WithPassword(password string) *ZDBBuilder

WithPassword sets the password to the zdb

func (*ZDBBuilder) WithPoolID

func (z *ZDBBuilder) WithPoolID(poolID int64) *ZDBBuilder

WithPoolID sets the poolID to the zdb

func (*ZDBBuilder) WithPublic

func (z *ZDBBuilder) WithPublic(public bool) *ZDBBuilder

WithPublic sets if public to the zdb

func (*ZDBBuilder) WithSize

func (z *ZDBBuilder) WithSize(size int64) *ZDBBuilder

WithSize sets the size on the zdb

func (*ZDBBuilder) WithStatsAggregator

func (z *ZDBBuilder) WithStatsAggregator(aggregators []workloads.StatsAggregator) *ZDBBuilder

WithStatsAggregator sets the stats aggregators to the zdb

Jump to

Keyboard shortcuts

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