core

package
v0.0.0-...-de24bab Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeRequest

func MakeRequest(request Request) (body []byte, statusCode int, err error)

MakeRequest function based on inputs

func PrepareAuthHeaders

func PrepareAuthHeaders(header map[string]string) string

PrepareAuthHeaders ..

Types

type ClusterConfig

type ClusterConfig struct {
}

ClusterConfig the configuration structure for k8s clusters

func LoadClusterConfig

func LoadClusterConfig(configPath string) (ClusterConfig, error)

LoadClusterConfig : load configuration file for K8s cluster

type ClusterManager

type ClusterManager interface {
	// Create :
	Create() (ClusterState, error)
	// Update :
	Update() error
	// Scale :
	Scale(num int)
	// Destroy :
	Destroy() error
	// Status:
	Status() (string, error)
	// Describe
	Describe() (string, error)
}

ClusterManager is the interface for managing K8s clusters

type ClusterManagerFactory

type ClusterManagerFactory interface {
	// Init : initialize a ClusterManager interface
	Init() (*ClusterManager, error)
}

ClusterManagerFactory : factory method for the Cluster Manager

type ClusterState

type ClusterState struct {
}

ClusterState the k8s cluster state

type IAMConfig

type IAMConfig interface {
	Init() error
	RefreshAccessToken() (string, error)
	GetAccessToken() (string, error)
}

IAMConfig : interface for generic IAM manager

type InfrastructureConfig

type InfrastructureConfig struct {
	Nodes []NodeConfig `yaml:"nodes"`
}

InfrastructureConfig the configuration for an infrastructure creation

type InfrastructureManager

type InfrastructureManager interface {
	// Create :
	Create() error
	// Update :
	Update() error
	// Scale :
	Scale(nodeLabel NodeLabel, num int) error
	// Destroy :
	Destroy() error
	// Status:
	Status() error
	// Describe
	Describe() error
}

InfrastructureManager is the interface for any plugin for cluster creation

type InfrastructureManagerFactory

type InfrastructureManagerFactory interface {
	// Init : initialize factory
	Init() (*InfrastructureManager, error)
}

InfrastructureManagerFactory :

type InfrastructureState

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

InfrastructureState descriptor

type NodeConfig

type NodeConfig struct {
	Image   string      `yaml:"host"`
	CPUs    string      `yaml:"CPUs,omitempty"`
	RAM     string      `yaml:"RAM,omitempty"`
	Flavor  string      `yaml:"flavor,omitempty"`
	Network NodeNetwork `yaml:"network"`
	Roles   []NodeRole  `yaml:"roles"`
	Labels  []NodeLabel `yaml:"labels,omitempty"`
	Count   int         `yaml:"count,omitempty"`
}

NodeConfig :

type NodeLabel

type NodeLabel struct {
	Key   string
	Value string
}

NodeLabel : label description of a node

type NodeNetwork

type NodeNetwork struct {
	Ports       []int  `yaml:"ports"`
	IsPublic    bool   `yaml:"is_public"`
	NetworkID   string `yaml:"network_id,omitempty"`
	NetworkName string `yaml:"network_name,omitempty"`
}

NodeNetwork : describe network configuration for the node

type NodeRole

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

NodeRole : role description of a node

type Request

type Request struct {
	URL         string
	RequestType string
	Headers     map[string]string
	AuthUser    string
	AuthPwd     string
	Content     []byte
	Timeout     time.Duration
}

Request input struct

Jump to

Keyboard shortcuts

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