Documentation ¶
Index ¶
- Constants
- type Backend
- type DeviceType
- type Encryption
- type EncryptionAlgorithm
- type EncryptionKey
- type GatewayFQDNProxy
- type GatewayFQDNResult
- type GatewayNameProxy
- type GatewayProxyResult
- type MachineCapacity
- type MachineInterface
- type MachineMount
- type MachineNetwork
- type NetID
- type Network
- type Peer
- type PublicIP
- type PublicIP4
- type PublicIPResult
- type QuantumCompression
- type QuantumSafeConfig
- type QuantumSafeFS
- type QuantumSafeFSConfig
- type QuantumSafeMeta
- type QuatumSafeFSResult
- type ZDB
- type ZDBMode
- type ZDBResult
- type ZMachine
- type ZMachineResult
- type ZMount
- type ZMountResult
- type ZdbBackend
- type ZdbGroup
Constants ¶
const ( // ZMountType type ZMountType gridtypes.WorkloadType = "zmount" // NetworkType type NetworkType gridtypes.WorkloadType = "network" // ZDBType type ZDBType gridtypes.WorkloadType = "zdb" // ZMachineType type ZMachineType gridtypes.WorkloadType = "zmachine" //PublicIPv4Type type [deprecated] PublicIPv4Type gridtypes.WorkloadType = "ipv4" //PublicIPType type is the new way to assign public ips // to a VM. this has flags (V4, and V6) that has to be set. PublicIPType gridtypes.WorkloadType = "ip" // GatewayNameProxyType type GatewayNameProxyType gridtypes.WorkloadType = "gateway-name-proxy" // GatewayFQDNProxyType type GatewayFQDNProxyType gridtypes.WorkloadType = "gateway-fqdn-proxy" // QuantumSafeFSType type QuantumSafeFSType gridtypes.WorkloadType = "qsfs" )
const ( ZDBModeUser = "user" ZDBModeSeq = "seq" )
Enumeration of the modes 0-db can operate in
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend string
func (Backend) Valid ¶
check if valid http://x.x.x.x:port or [::]:port
type DeviceType ¶
type DeviceType string
DeviceType is the actual type of hardware that the storage device runs on, i.e. SSD or HDD
const ( SSDDevice DeviceType = "ssd" HDDDevice DeviceType = "hdd" )
Known device types
func (DeviceType) String ¶
func (d DeviceType) String() string
type Encryption ¶
type Encryption struct { Algorithm EncryptionAlgorithm `json:"algorithm" toml:"algorithm"` Key EncryptionKey `json:"key" toml:"key"` }
type EncryptionAlgorithm ¶
type EncryptionAlgorithm string
type EncryptionKey ¶
type EncryptionKey []byte
func (EncryptionKey) MarshalText ¶
func (k EncryptionKey) MarshalText() ([]byte, error)
func (*EncryptionKey) UnmarshalText ¶
func (k *EncryptionKey) UnmarshalText(data []byte) error
func (EncryptionKey) Valid ¶
func (k EncryptionKey) Valid() error
type GatewayFQDNProxy ¶
type GatewayFQDNProxy struct { // FQDN the fully qualified domain name to use (cannot be present with Name) FQDN string `json:"fqdn"` // Passthroug whether to pass tls traffic or not TLSPassthrough bool `json:"tls_passthrough"` // Backends are list of backend ips Backends []Backend `json:"backends"` }
GatewayFQDNProxy definition. this will proxy name.<zos.domain> to backends
func (GatewayFQDNProxy) Valid ¶
func (g GatewayFQDNProxy) Valid(getter gridtypes.WorkloadGetter) error
type GatewayNameProxy ¶
type GatewayNameProxy struct { // Name the fully qualified domain name to use (cannot be present with Name) Name string `json:"name"` // Passthroug whether to pass tls traffic or not TLSPassthrough bool `json:"tls_passthrough"` // Backends are list of backend ips Backends []Backend `json:"backends"` }
GatewayNameProxy definition. this will proxy name.<zos.domain> to backends
func (GatewayNameProxy) Valid ¶
func (g GatewayNameProxy) Valid(getter gridtypes.WorkloadGetter) error
type GatewayProxyResult ¶
type GatewayProxyResult struct {
FQDN string `json:"fqdn"`
}
GatewayProxyResult results
type MachineCapacity ¶
MachineCapacity structure
func (*MachineCapacity) Challenge ¶
func (c *MachineCapacity) Challenge(w io.Writer) error
Challenge builder
func (*MachineCapacity) String ¶
func (c *MachineCapacity) String() string
type MachineInterface ¶
type MachineInterface struct { // Network name (znet name) to join Network gridtypes.Name `json:"network"` // IP of the zmachine on this network must be a valid Ip in the // selected network IP net.IP `json:"ip"` }
MachineInterface structure
type MachineMount ¶
type MachineMount struct { // Name is name of a zmount. The name must be a valid zmount // in the same deployment as the zmachine Name gridtypes.Name `json:"name"` // Mountpoint inside the container. Not used if the zmachine // is running in a vm mode. Mountpoint string `json:"mountpoint"` }
MachineMount structure
type MachineNetwork ¶
type MachineNetwork struct { // PublicIP optional public IP attached to this machine. If set // it must be a valid name of a PublicIP workload in the same deployment PublicIP gridtypes.Name `json:"public_ip"` // Planetary support planetary network Planetary bool `json:"planetary"` // Interfaces list of user znets to join Interfaces []MachineInterface `json:"interfaces"` }
MachineNetwork structure
type NetID ¶
type NetID string
NetID is a type defining the ID of a network
type Network ¶
type Network struct { // IP range of the network, must be an IPv4 /16 // for example a 10.1.0.0/16 NetworkIPRange gridtypes.IPNet `json:"ip_range"` // IPV4 subnet for this network resource // this must be a valid subnet of the entire network ip range. // for example 10.1.1.0/24 Subnet gridtypes.IPNet `json:"subnet"` // The private wg key of this node (this peer) which is installing this // network workload right now. // This has to be filled in by the user (and not generated for example) // because other peers need to be installed as well (with this peer public key) // hence it's easier to configure everything one time at the user side and then // apply everything on all nodes at once WGPrivateKey string `json:"wireguard_private_key"` // WGListenPort is the wireguard listen port on this node. this has // to be filled in by the user for same reason as private key (other nodes need to know about it) // To find a free port you have to ask the node first by a call over RMB about which ports are possible // to use. WGListenPort uint16 `json:"wireguard_listen_port"` // Peers is a list of other peers in this network Peers []Peer `json:"peers"` }
Network is the description of a part of a network local to a specific node. A network workload defines a wireguard network that is usually spans multiple nodes. One of the nodes must work as an access node in other words, it must be reachable from other nodes, hence it needs to have a `PublicConfig`. Since the user library creates all deployments upfront then all wireguard keys, and ports must be pre-determinstic and must be also created upfront. A network structure basically must consist of - The network information (IP range) must be an ipv4 /16 range - The local (node) peer definition (subnet of the network ip range, wireguard secure key, wireguard port if any) - List of other peers that are part of the same network with their own config - For each PC or a laptop (for each wireguard peer) there must be a peer in the peer list (on all nodes) This is why this can get complicated.
type Peer ¶
type Peer struct { // IPV4 subnet of the network resource of the peer Subnet gridtypes.IPNet `json:"subnet"` // WGPublicKey of the peer (driven from its private key) WGPublicKey string `json:"wireguard_public_key"` // Allowed Ips is related to his subnet. // todo: remove and derive from subnet AllowedIPs []gridtypes.IPNet `json:"allowed_ips"` // Entrypoint of the peer Endpoint string `json:"endpoint"` }
Peer is the description of a peer of a NetResource
type PublicIP ¶
type PublicIP struct { // V4 use one of the reserved Ipv4 from your contract. The Ipv4 // itself costs money + the network traffic V4 bool `json:"v4"` // V6 get an ipv6 for the VM. this is for free // but the consumed capacity (network traffic) is not V6 bool `json:"v6"` }
type PublicIP4 ¶
type PublicIP4 struct{}
PublicIP4 structure this is a deprecated type and only kept here for backward compatibility with older deployments. Please use PublicIP instead
type PublicIPResult ¶
type PublicIPResult struct { // IP of the VM. The IP must be part of the subnet available in the network // resource defined by the networkID on this node IP gridtypes.IPNet `json:"ip"` // IPv6 of the VM. IPv6 gridtypes.IPNet `json:"ip6"` // Gateway: this fields is only here because we have no idea what is the // gateway of that ip without consulting the farmer. Currently this // component does not exist. hence as a temporaray solution the user must // also provide Gateway net.IP `json:"gateway"` }
PublicIPResult result returned by publicIP reservation
type QuantumCompression ¶
type QuantumCompression struct {
Algorithm string `json:"algorithm" toml:"algorithm"`
}
type QuantumSafeConfig ¶
type QuantumSafeConfig struct { Prefix string `json:"prefix" toml:"prefix"` Encryption Encryption `json:"encryption" toml:"encryption"` Backends []ZdbBackend `json:"backends" toml:"backends"` }
type QuantumSafeFS ¶
type QuantumSafeFS struct { Cache gridtypes.Unit `json:"cache"` Config QuantumSafeFSConfig `json:"config"` }
func (QuantumSafeFS) Valid ¶
func (q QuantumSafeFS) Valid(getter gridtypes.WorkloadGetter) error
type QuantumSafeFSConfig ¶
type QuantumSafeFSConfig struct { MinimalShards uint32 `json:"minimal_shards" toml:"minimal_shards"` ExpectedShards uint32 `json:"expected_shards" toml:"expected_shards"` RedundantGroups uint32 `json:"redundant_groups" toml:"redundant_groups"` RedundantNodes uint32 `json:"redundant_nodes" toml:"redundant_nodes"` MaxZDBDataDirSize uint32 `json:"max_zdb_data_dir_size" toml:"max_zdb_data_dir_size"` Encryption Encryption `json:"encryption" toml:"encryption"` Meta QuantumSafeMeta `json:"meta" toml:"meta"` Groups []ZdbGroup `json:"groups" toml:"groups"` Compression QuantumCompression `json:"compression" toml:"compression"` }
type QuantumSafeMeta ¶
type QuantumSafeMeta struct { Type string `json:"type" toml:"type"` Config QuantumSafeConfig `json:"config" toml:"config"` }
TODO: fix challenge (and validation?)
type QuatumSafeFSResult ¶
type ZDB ¶
type ZDB struct { Size gridtypes.Unit `json:"size"` Mode ZDBMode `json:"mode"` Password string `json:"password"` Public bool `json:"public"` }
ZDB namespace creation info
type ZMachine ¶
type ZMachine struct { // Flist of the zmachine, must be a valid url to an flist. FList string `json:"flist"` // Network configuration for machine network Network MachineNetwork `json:"network"` // Size of zmachine disk Size gridtypes.Unit `json:"size"` // ComputeCapacity configuration for machine cpu+memory ComputeCapacity MachineCapacity `json:"compute_capacity"` // Mounts configure mounts/disks attachments to this machine Mounts []MachineMount `json:"mounts"` // Entrypoint entrypoint of the container, if not set the configured one from the flist // is going to be used Entrypoint string `json:"entrypoint"` // Env variables available for a container Env map[string]string `json:"env"` Corex bool `json:"corex"` }
ZMachine reservation data
func (*ZMachine) MinRootSize ¶
type ZMachineResult ¶
type ZMachineResult struct { ID string `json:"id"` IP string `json:"ip"` YggIP string `json:"ygg_ip"` }
ZMachineResult result returned by VM reservation
type ZMount ¶
ZMount defines a mount point
type ZMountResult ¶
type ZMountResult struct {
ID string `json:"volume_id"`
}
ZMountResult is the information return to the BCDB after deploying a volume