workloads

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: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WorkloadTypes = map[WorkloadTypeEnum]string{
	WorkloadTypeZDB:             "zdb",
	WorkloadTypeContainer:       "container",
	WorkloadTypeVolume:          "volume",
	WorkloadTypeNetwork:         "network",
	WorkloadTypeKubernetes:      "kubernetes",
	WorkloadTypeProxy:           "proxy",
	WorkloadTypeReverseProxy:    "reverse_proxy",
	WorkloadTypeSubDomain:       "subdomain",
	WorkloadTypeDomainDelegate:  "domain_delegate",
	WorkloadTypeGateway4To6:     "gateway4to6",
	WorkloadTypeNetworkResource: "network_resource",
}

WorkloadTypes is a map of all the supported workload type

Functions

This section is empty.

Types

type Capaciter

type Capaciter interface {
	GetRSU() RSU
}

type Container

type Container struct {
	ReservationInfo `bson:",inline"`

	Flist             string              `bson:"flist" json:"flist"`
	HubUrl            string              `bson:"hub_url" json:"hub_url"`
	Environment       map[string]string   `bson:"environment" json:"environment"`
	SecretEnvironment map[string]string   `bson:"secret_environment" json:"secret_environment"`
	Entrypoint        string              `bson:"entrypoint" json:"entrypoint"`
	Interactive       bool                `bson:"interactive" json:"interactive"`
	Volumes           []ContainerMount    `bson:"volumes" json:"volumes"`
	NetworkConnection []NetworkConnection `bson:"network_connection" json:"network_connection"`
	Stats             []Stats             `bson:"stats" json:"stats"`
	Logs              []Logs              `bson:"logs" json:"logs"`
	Capacity          ContainerCapacity   `bson:"capcity" json:"capacity"`
}

func (*Container) GetRSU

func (c *Container) GetRSU() RSU

func (*Container) SignatureChallenge

func (c *Container) SignatureChallenge() ([]byte, error)

type ContainerCapacity

type ContainerCapacity struct {
	Cpu      int64        `bson:"cpu" json:"cpu"`
	Memory   int64        `bson:"memory" json:"memory"`
	DiskSize uint64       `bson:"disk_size" json:"disk_size"`
	DiskType DiskTypeEnum `bson:"disk_type" json:"disk_type"`
}

func (ContainerCapacity) GetRSU

func (c ContainerCapacity) GetRSU() RSU

func (ContainerCapacity) SigningEncode added in v0.4.2

func (c ContainerCapacity) SigningEncode(w io.Writer) error

type ContainerMount

type ContainerMount struct {
	VolumeId   string `bson:"volume_id" json:"volume_id"`
	Mountpoint string `bson:"mountpoint" json:"mountpoint"`
}

func (ContainerMount) SigningEncode added in v0.4.2

func (c ContainerMount) SigningEncode(w io.Writer) error

type DiskTypeEnum

type DiskTypeEnum uint8
const (
	DiskTypeHDD DiskTypeEnum = iota
	DiskTypeSSD
)

func (DiskTypeEnum) String

func (e DiskTypeEnum) String() string

type Gateway4To6

type Gateway4To6 struct {
	ReservationInfo `bson:",inline"`

	PublicKey string `bson:"public_key" json:"public_key"`
}

func (*Gateway4To6) GetRSU

func (g *Gateway4To6) GetRSU() RSU

func (*Gateway4To6) SignatureChallenge

func (g *Gateway4To6) SignatureChallenge() ([]byte, error)

type GatewayDelegate

type GatewayDelegate struct {
	ReservationInfo `bson:",inline"`

	Domain string `bson:"domain" json:"domain"`
}

func (*GatewayDelegate) GetRSU

func (g *GatewayDelegate) GetRSU() RSU

func (*GatewayDelegate) SignatureChallenge

func (d *GatewayDelegate) SignatureChallenge() ([]byte, error)

type GatewayProxy

type GatewayProxy struct {
	ReservationInfo `bson:",inline"`

	Domain  string `bson:"domain" json:"domain"`
	Addr    string `bson:"addr" json:"addr"`
	Port    uint32 `bson:"port" json:"port"`
	PortTLS uint32 `bson:"port_tls" json:"port_tls"`
}

func (*GatewayProxy) GetRSU

func (g *GatewayProxy) GetRSU() RSU

func (*GatewayProxy) SignatureChallenge

func (p *GatewayProxy) SignatureChallenge() ([]byte, error)

type GatewayReverseProxy

type GatewayReverseProxy struct {
	ReservationInfo `bson:",inline"`

	Domain string `bson:"domain" json:"domain"`
	Secret string `bson:"secret" json:"secret"`
}

func (*GatewayReverseProxy) GetRSU

func (g *GatewayReverseProxy) GetRSU() RSU

func (*GatewayReverseProxy) SignatureChallenge

func (p *GatewayReverseProxy) SignatureChallenge() ([]byte, error)

type GatewaySubdomain

type GatewaySubdomain struct {
	ReservationInfo `bson:",inline"`

	Domain string   `bson:"domain" json:"domain"`
	IPs    []string `bson:"ips" json:"ips"`
}

func (*GatewaySubdomain) GetRSU

func (g *GatewaySubdomain) GetRSU() RSU

func (*GatewaySubdomain) SignatureChallenge

func (s *GatewaySubdomain) SignatureChallenge() ([]byte, error)

type K8S

type K8S struct {
	ReservationInfo `bson:",inline"`

	Size            int64             `bson:"size" json:"size"`
	ClusterSecret   string            `bson:"cluster_secret" json:"cluster_secret"`
	NetworkId       string            `bson:"network_id" json:"network_id"`
	Ipaddress       net.IP            `bson:"ipaddress" json:"ipaddress"`
	MasterIps       []net.IP          `bson:"master_ips" json:"master_ips"`
	SshKeys         []string          `bson:"ssh_keys" json:"ssh_keys"`
	StatsAggregator []StatsAggregator `bson:"stats_aggregator" json:"stats_aggregator"`
}

func (*K8S) GetRSU

func (k *K8S) GetRSU() RSU

func (*K8S) SignatureChallenge

func (k *K8S) SignatureChallenge() ([]byte, error)

type Logs

type Logs struct {
	Type string    `bson:"type" json:"type"`
	Data LogsRedis `bson:"data" json:"data"`
}

func (Logs) SigningEncode added in v0.4.2

func (c Logs) SigningEncode(w io.Writer) error

type LogsRedis

type LogsRedis struct {
	Stdout string `bson:"stdout" json:"stdout"`
	Stderr string `bson:"stderr" json:"stderr"`

	// Same as stdout, stderr urls but encrypted
	// with the node public key.
	SecretStdout string `bson:"secret_stdout" json:"secret_stdout"`
	SecretStderr string `bson:"secret_stderr" json:"secret_stderr"`
}

func (LogsRedis) SigningEncode added in v0.4.2

func (l LogsRedis) SigningEncode(w io.Writer) error

type Network

type Network struct {
	Name             string               `bson:"name" json:"name"`
	WorkloadId       int64                `bson:"workload_id" json:"workload_id"`
	Iprange          schema.IPRange       `bson:"iprange" json:"iprange"`
	StatsAggregator  []StatsAggregator    `bson:"stats_aggregator" json:"stats_aggregator"`
	NetworkResources []NetworkNetResource `bson:"network_resources" json:"network_resources"`
	FarmerTid        int64                `bson:"farmer_tid" json:"farmer_tid"`
}

func (Network) ToNetworkResources

func (n Network) ToNetworkResources() []NetworkResource

func (Network) WorkloadID

func (n Network) WorkloadID() int64

type NetworkConnection

type NetworkConnection struct {
	NetworkId   string `bson:"network_id" json:"network_id"`
	Ipaddress   net.IP `bson:"ipaddress" json:"ipaddress"`
	PublicIp6   bool   `bson:"public_ip6" json:"public_ip6"`
	YggdrasilIP bool   `bson:"yggdrasil_ip" json:"yggdrasil_ip"`
}

func (NetworkConnection) SigningEncode added in v0.4.2

func (n NetworkConnection) SigningEncode(w io.Writer) error

type NetworkNetResource

type NetworkNetResource struct {
	NodeId                       string          `bson:"node_id" json:"node_id"`
	WireguardPrivateKeyEncrypted string          `bson:"wireguard_private_key_encrypted" json:"wireguard_private_key_encrypted"`
	WireguardPublicKey           string          `bson:"wireguard_public_key" json:"wireguard_public_key"`
	WireguardListenPort          int64           `bson:"wireguard_listen_port" json:"wireguard_listen_port"`
	Iprange                      schema.IPRange  `bson:"iprange" json:"iprange"`
	Peers                        []WireguardPeer `bson:"peers" json:"peers"`
}

type NetworkResource

type NetworkResource struct {
	ReservationInfo `bson:",inline"`

	Name                         string            `bson:"name" json:"name"`
	NetworkIprange               schema.IPRange    `bson:"network_iprange" json:"network_iprange"`
	WireguardPrivateKeyEncrypted string            `bson:"wireguard_private_key_encrypted" json:"wireguard_private_key_encrypted"`
	WireguardPublicKey           string            `bson:"wireguard_public_key" json:"wireguard_public_key"`
	WireguardListenPort          int64             `bson:"wireguard_listen_port" json:"wireguard_listen_port"`
	Iprange                      schema.IPRange    `bson:"iprange" json:"iprange"`
	Peers                        []WireguardPeer   `bson:"peers" json:"peers"`
	StatsAggregator              []StatsAggregator `bson:"stats_aggregator" json:"stats_aggregator"`
}

func (*NetworkResource) GetRSU

func (n *NetworkResource) GetRSU() RSU

func (*NetworkResource) SignatureChallenge

func (n *NetworkResource) SignatureChallenge() ([]byte, error)

type NextActionEnum

type NextActionEnum uint8
const (
	NextActionCreate NextActionEnum = iota
	NextActionSign
	NextActionPay
	NextActionDeploy
	NextActionDelete
	NextActionInvalid
	NextActionDeleted
	NextActionMigrated
)

func (NextActionEnum) String

func (e NextActionEnum) String() string

type RSU

type RSU struct {
	CRU int64
	SRU float64
	HRU float64
	MRU float64
}

type Reservation

type Reservation struct {
	ID                  schema.ID          `bson:"_id" json:"id"`
	Json                string             `bson:"json" json:"json"`
	DataReservation     ReservationData    `bson:"data_reservation" json:"data_reservation"`
	CustomerTid         int64              `bson:"customer_tid" json:"customer_tid"`
	CustomerSignature   string             `bson:"customer_signature" json:"customer_signature"`
	NextAction          NextActionEnum     `bson:"next_action" json:"next_action"`
	SignaturesProvision []SigningSignature `bson:"signatures_provision" json:"signatures_provision"`
	SignaturesFarmer    []SigningSignature `bson:"signatures_farmer" json:"signatures_farmer"`
	SignaturesDelete    []SigningSignature `bson:"signatures_delete" json:"signatures_delete"`
	Epoch               schema.Date        `bson:"epoch" json:"epoch"`
	Metadata            string             `bson:"metadata" json:"metadata"`
	Results             []Result           `bson:"results" json:"results"`
}

type ReservationData

type ReservationData struct {
	Description             string                `bson:"description" json:"description"`
	Currencies              []string              `bson:"currencies" json:"currencies"`
	SigningRequestProvision SigningRequest        `bson:"signing_request_provision" json:"signing_request_provision"`
	SigningRequestDelete    SigningRequest        `bson:"signing_request_delete" json:"signing_request_delete"`
	Containers              []Container           `bson:"containers" json:"containers"`
	Volumes                 []Volume              `bson:"volumes" json:"volumes"`
	Zdbs                    []ZDB                 `bson:"zdbs" json:"zdbs"`
	Networks                []Network             `bson:"networks" json:"networks"`
	NetworkResources        []NetworkResource     `bson:"network_resource" json:"network_resource"`
	Kubernetes              []K8S                 `bson:"kubernetes" json:"kubernetes"`
	Proxies                 []GatewayProxy        `bson:"proxies" json:"proxies"`
	ReverseProxy            []GatewayReverseProxy `bson:"reverse_proxies" json:"reverse_proxies"`
	Subdomains              []GatewaySubdomain    `bson:"subdomains" json:"subdomains"`
	DomainDelegates         []GatewayDelegate     `bson:"domain_delegates" json:"domain_delegates"`
	Gateway4To6s            []Gateway4To6         `bson:"gateway4to6" json:"gateway4to6"`
	ExpirationProvisioning  schema.Date           `bson:"expiration_provisioning" json:"expiration_provisioning"`
	ExpirationReservation   schema.Date           `bson:"expiration_reservation" json:"expiration_reservation"`
}

type ReservationInfo

type ReservationInfo struct {
	WorkloadId int64  `bson:"workload_id" json:"workload_id"`
	NodeId     string `bson:"node_id" json:"node_id"`
	PoolId     int64  `bson:"pool_id" json:"pool_id"`

	// Referene to an old reservation, used in conversion
	Reference string `bson:"reference" json:"reference"`

	Description             string         `bson:"description" json:"description"`
	SigningRequestProvision SigningRequest `bson:"signing_request_provision" json:"signing_request_provision"`
	SigningRequestDelete    SigningRequest `bson:"signing_request_delete" json:"signing_request_delete"`

	ID                  schema.ID          `bson:"_id" json:"id"`
	Json                string             `bson:"json" json:"json"`
	CustomerTid         int64              `bson:"customer_tid" json:"customer_tid"`
	CustomerSignature   string             `bson:"customer_signature" json:"customer_signature"`
	NextAction          NextActionEnum     `bson:"next_action" json:"next_action"`
	SignaturesProvision []SigningSignature `bson:"signatures_provision" json:"signatures_provision"`
	SignatureFarmer     SigningSignature   `bson:"signature_farmer" json:"signature_farmer"`
	SignaturesDelete    []SigningSignature `bson:"signatures_delete" json:"signatures_delete"`
	Epoch               schema.Date        `bson:"epoch" json:"epoch"`
	Metadata            string             `bson:"metadata" json:"metadata"`
	Result              Result             `bson:"result" json:"result"`
	WorkloadType        WorkloadTypeEnum   `bson:"workload_type" json:"workload_type"`
	Version             int                `bson:"version" json:"version"`
}

func (*ReservationInfo) GetCustomerSignature

func (i *ReservationInfo) GetCustomerSignature() string

func (*ReservationInfo) GetCustomerTid

func (i *ReservationInfo) GetCustomerTid() int64

func (*ReservationInfo) GetDescription

func (i *ReservationInfo) GetDescription() string

func (*ReservationInfo) GetEpoch

func (i *ReservationInfo) GetEpoch() schema.Date

func (*ReservationInfo) GetID

func (i *ReservationInfo) GetID() schema.ID

func (*ReservationInfo) GetJson

func (i *ReservationInfo) GetJson() string

func (*ReservationInfo) GetMetadata

func (i *ReservationInfo) GetMetadata() string

func (*ReservationInfo) GetNextAction

func (i *ReservationInfo) GetNextAction() NextActionEnum

func (*ReservationInfo) GetNodeID

func (i *ReservationInfo) GetNodeID() string

func (*ReservationInfo) GetPoolID

func (i *ReservationInfo) GetPoolID() int64

func (*ReservationInfo) GetReference

func (i *ReservationInfo) GetReference() string

func (*ReservationInfo) GetResult

func (i *ReservationInfo) GetResult() Result

func (*ReservationInfo) GetSignatureFarmer

func (i *ReservationInfo) GetSignatureFarmer() SigningSignature

func (*ReservationInfo) GetSignaturesDelete

func (i *ReservationInfo) GetSignaturesDelete() []SigningSignature

func (*ReservationInfo) GetSignaturesProvision

func (i *ReservationInfo) GetSignaturesProvision() []SigningSignature

func (*ReservationInfo) GetSigningRequestDelete

func (i *ReservationInfo) GetSigningRequestDelete() SigningRequest

func (*ReservationInfo) GetSigningRequestProvision

func (i *ReservationInfo) GetSigningRequestProvision() SigningRequest

func (*ReservationInfo) GetVersion added in v0.4.2

func (i *ReservationInfo) GetVersion() int

func (*ReservationInfo) GetWorkloadType

func (i *ReservationInfo) GetWorkloadType() WorkloadTypeEnum

func (*ReservationInfo) PushSignatureDelete

func (i *ReservationInfo) PushSignatureDelete(signature SigningSignature)

func (*ReservationInfo) PushSignatureProvision

func (i *ReservationInfo) PushSignatureProvision(signature SigningSignature)

func (*ReservationInfo) SetCustomerSignature

func (i *ReservationInfo) SetCustomerSignature(signature string)

func (*ReservationInfo) SetCustomerTid

func (i *ReservationInfo) SetCustomerTid(tid int64)

func (*ReservationInfo) SetDescription

func (i *ReservationInfo) SetDescription(description string)

func (*ReservationInfo) SetEpoch

func (i *ReservationInfo) SetEpoch(date schema.Date)

func (*ReservationInfo) SetID

func (i *ReservationInfo) SetID(id schema.ID)

func (*ReservationInfo) SetJson

func (i *ReservationInfo) SetJson(json string)

func (*ReservationInfo) SetMetadata

func (i *ReservationInfo) SetMetadata(metadata string)

func (*ReservationInfo) SetNextAction

func (i *ReservationInfo) SetNextAction(next NextActionEnum)

func (*ReservationInfo) SetPoolID

func (i *ReservationInfo) SetPoolID(poolID int64)

func (*ReservationInfo) SetReference

func (i *ReservationInfo) SetReference(ref string)

func (*ReservationInfo) SetResult

func (i *ReservationInfo) SetResult(result Result)

func (*ReservationInfo) SetSignatureFarmer

func (i *ReservationInfo) SetSignatureFarmer(signature SigningSignature)

func (*ReservationInfo) SetSignaturesDelete

func (i *ReservationInfo) SetSignaturesDelete(signatures []SigningSignature)

func (*ReservationInfo) SetSignaturesProvision

func (i *ReservationInfo) SetSignaturesProvision(signatures []SigningSignature)

func (*ReservationInfo) SetSigningRequestDelete

func (i *ReservationInfo) SetSigningRequestDelete(request SigningRequest)

func (*ReservationInfo) SetSigningRequestProvision

func (i *ReservationInfo) SetSigningRequestProvision(request SigningRequest)

func (*ReservationInfo) SetVersion added in v0.4.2

func (i *ReservationInfo) SetVersion(version int)

func (*ReservationInfo) SignatureChallenge

func (i *ReservationInfo) SignatureChallenge() ([]byte, error)

SignatureChallenge return a slice of byte containing all the date used to generate the signature of the workload

func (*ReservationInfo) UniqueWorkloadID

func (i *ReservationInfo) UniqueWorkloadID() string

func (*ReservationInfo) WorkloadID

func (i *ReservationInfo) WorkloadID() int64

type ReservationWorkload

type ReservationWorkload struct {
	WorkloadId string           `bson:"workload_id" json:"workload_id"`
	User       string           `bson:"user" json:"user"`
	PoolID     int64            `bson:"pool_id" json:"pool_id"`
	Type       WorkloadTypeEnum `bson:"type" json:"type"`
	Content    interface{}      `bson:"content" json:"content"`
	Created    schema.Date      `bson:"created" json:"created"`
	Duration   int64            `bson:"duration" json:"duration"`
	Signature  string           `bson:"signature" json:"signature"`
	ToDelete   bool             `bson:"to_delete" json:"to_delete"`
}

type Result

type Result struct {
	Category   WorkloadTypeEnum `bson:"category" json:"category"`
	WorkloadId string           `bson:"workload_id" json:"workload_id"`
	DataJson   json.RawMessage  `bson:"data_json" json:"data_json"`
	Signature  string           `bson:"signature" json:"signature"`
	State      ResultStateEnum  `bson:"state" json:"state"`
	Message    string           `bson:"message" json:"message"`
	Epoch      schema.Date      `bson:"epoch" json:"epoch"`
	NodeId     string           `bson:"node_id" json:"node_id"`
}

type ResultStateEnum

type ResultStateEnum uint8
const (
	ResultStateError ResultStateEnum = iota
	ResultStateOK
	ResultStateDeleted
)

func (ResultStateEnum) String

func (e ResultStateEnum) String() string

type SigningRequest

type SigningRequest struct {
	Signers   []int64 `bson:"signers" json:"signers"`
	QuorumMin int64   `bson:"quorum_min" json:"quorum_min"`
}

type SigningSignature

type SigningSignature struct {
	Tid       int64       `bson:"tid" json:"tid"`
	Signature string      `bson:"signature" json:"signature"`
	Epoch     schema.Date `bson:"epoch" json:"epoch"`
}

type Stats added in v0.4.2

type Stats struct {
	Type string          `bson:"type" json:"type"`
	Data json.RawMessage `bson:"data" json:"data"`
}

func (Stats) SigningEncode added in v0.4.2

func (s Stats) SigningEncode(w io.Writer) error

type StatsAggregator

type StatsAggregator struct {
}

Stub type not used (for now)

func (StatsAggregator) SigningEncode added in v0.4.2

func (s StatsAggregator) SigningEncode(w io.Writer) error

type StatsRedis

type StatsRedis struct {
	Endpoint string `bson:"endpoint" json:"endpoint"`
}

type Volume

type Volume struct {
	ReservationInfo `bson:",inline"`

	Size int64          `bson:"size" json:"size"`
	Type VolumeTypeEnum `bson:"type" json:"type"`
}

func (*Volume) GetRSU

func (v *Volume) GetRSU() RSU

func (*Volume) SignatureChallenge

func (v *Volume) SignatureChallenge() ([]byte, error)

type VolumeTypeEnum

type VolumeTypeEnum uint8
const (
	VolumeTypeHDD VolumeTypeEnum = iota
	VolumeTypeSSD
)

func (VolumeTypeEnum) String

func (e VolumeTypeEnum) String() string

type WireguardPeer

type WireguardPeer struct {
	PublicKey      string           `bson:"public_key" json:"public_key"`
	Endpoint       string           `bson:"endpoint" json:"endpoint"`
	Iprange        schema.IPRange   `bson:"iprange" json:"iprange"`
	AllowedIprange []schema.IPRange `bson:"allowed_iprange" json:"allowed_iprange"`
}

func (*WireguardPeer) SigningEncode added in v0.4.2

func (p *WireguardPeer) SigningEncode(w io.Writer) error

type WorkloadTypeEnum

type WorkloadTypeEnum uint8
const (
	WorkloadTypeZDB WorkloadTypeEnum = iota
	WorkloadTypeContainer
	WorkloadTypeVolume
	WorkloadTypeNetwork
	WorkloadTypeKubernetes
	WorkloadTypeProxy
	WorkloadTypeReverseProxy
	WorkloadTypeSubDomain
	WorkloadTypeDomainDelegate
	WorkloadTypeGateway4To6
	WorkloadTypeNetworkResource
)

func (WorkloadTypeEnum) String

func (e WorkloadTypeEnum) String() string

type Workloader

type Workloader interface {
	WorkloadID() int64
	GetWorkloadType() WorkloadTypeEnum
	GetID() schema.ID
	SetID(id schema.ID)
	GetJson() string
	SetJson(json string)
	GetCustomerTid() int64
	SetCustomerTid(tid int64)
	GetCustomerSignature() string
	SetCustomerSignature(signature string)
	GetNextAction() NextActionEnum
	SetNextAction(next NextActionEnum)
	GetSignaturesProvision() []SigningSignature
	PushSignatureProvision(signature SigningSignature)
	GetSignatureFarmer() SigningSignature
	SetSignatureFarmer(signature SigningSignature)
	GetSignaturesDelete() []SigningSignature
	PushSignatureDelete(signature SigningSignature)
	GetEpoch() schema.Date
	SetEpoch(date schema.Date)
	GetMetadata() string
	SetMetadata(metadata string)
	GetResult() Result
	SetResult(result Result)
	GetDescription() string
	SetDescription(description string)
	GetSigningRequestProvision() SigningRequest
	SetSigningRequestProvision(request SigningRequest)
	GetSigningRequestDelete() SigningRequest
	SetSigningRequestDelete(request SigningRequest)
	SetSignaturesProvision(signatures []SigningSignature)
	SetSignaturesDelete(signatuers []SigningSignature)
	SignatureChallenge() ([]byte, error)
	SetPoolID(int64)
	GetPoolID() int64
	GetNodeID() string
	UniqueWorkloadID() string
	SetReference(string)
	GetReference() string
	GetVersion() int
	SetVersion(version int)

	Capaciter
}

func UnmarshalBSON

func UnmarshalBSON(buffer []byte) (Workloader, error)

UnmarshalBSON decodes a workload from BSON format

func UnmarshalJSON

func UnmarshalJSON(buffer []byte) (Workloader, error)

UnmarshalJSON decodes a workload from JSON format

type ZDB

type ZDB struct {
	ReservationInfo `bson:",inline"`

	Size            int64             `bson:"size" json:"size"`
	Mode            ZDBModeEnum       `bson:"mode" json:"mode"`
	Password        string            `bson:"password" json:"password"`
	DiskType        DiskTypeEnum      `bson:"disk_type" json:"disk_type"`
	Public          bool              `bson:"public" json:"public"`
	StatsAggregator []StatsAggregator `bson:"stats_aggregator" json:"stats_aggregator"`
}

func (*ZDB) GetRSU

func (z *ZDB) GetRSU() RSU

func (*ZDB) SignatureChallenge

func (z *ZDB) SignatureChallenge() ([]byte, error)

type ZDBModeEnum

type ZDBModeEnum uint8
const (
	ZDBModeSeq ZDBModeEnum = iota
	ZDBModeUser
)

func (ZDBModeEnum) String

func (e ZDBModeEnum) String() string

Jump to

Keyboard shortcuts

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