module

package
v0.0.0-...-48d3ca6 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinProxyPort = 10000
	MaxProxyPort = 16000
)

Variables

View Source
var StateEnum = &states{
	Created:    "Created",
	Deployed:   "Deployed",
	Undeployed: "Undeployed",
	Error:      "Error",
}

Functions

func CreateConnectionName

func CreateConnectionName(e1 string, e2 string) string

func CreateEndName

func CreateEndName(t string, n string) string

func ParseEndName

func ParseEndName(name string) (string, string)

Types

type CNFObject

type CNFObject struct {
	Metadata ObjectMetaData `json:"metadata"`
	Status   string         `json:"status"`
}

App contains metadata for Apps

func (*CNFObject) GetMetadata

func (c *CNFObject) GetMetadata() ObjectMetaData

func (*CNFObject) GetType

func (c *CNFObject) GetType() string

type CertificateObject

type CertificateObject struct {
	Metadata      ObjectMetaData        `json:"metadata"`
	Specification CertificateObjectSpec `json:"spec"`
	Data          CertificateObjectData `json:"data"`
}

App contains metadata for Apps

func (*CertificateObject) GetMetadata

func (c *CertificateObject) GetMetadata() ObjectMetaData

func (*CertificateObject) GetType

func (c *CertificateObject) GetType() string

type CertificateObjectData

type CertificateObjectData struct {
	CA   string `json:"ca"`
	Cert string `json:"cert"`
	Key  string `json:"key"`
}

type CertificateObjectSpec

type CertificateObjectSpec struct {
	IsCA        bool   `json:"isCA"`
	ClusterType string `json:"clusterType"`
}

CertificateObjectSpec contains the parameters

type ClusterSyncObject

type ClusterSyncObject struct {
	Metadata      ObjectMetaData        `json:"metadata"`
	Specification ClusterSyncObjectSpec `json:"spec"`
}

App contains metadata for Apps

func (*ClusterSyncObject) GetMetadata

func (c *ClusterSyncObject) GetMetadata() ObjectMetaData

func (*ClusterSyncObject) GetType

func (c *ClusterSyncObject) GetType() string

type ClusterSyncObjectSpec

type ClusterSyncObjectSpec struct {
	Kv []map[string]interface{} `json:"kv"`
}

ClusterSyncObjectSpec contains the parameters

type ConnectionEnd

type ConnectionEnd struct {
	Name       string `json:"name"`
	Type       string `json:"type"`
	IP         string `json:"ip"`
	ConnObject string `json:"-"`
}

func NewConnectionEnd

func NewConnectionEnd(conn_obj ControllerObject, ip string) ConnectionEnd

type ConnectionInfo

type ConnectionInfo struct {
	End1         ConnectionEnd        `json:"end1"`
	End2         ConnectionEnd        `json:"end2"`
	Resources    []ConnectionResource `json:"-"`
	State        string               `json:"state"`
	ErrorMessage string               `json:"message"`
}

ConnectionInfo contains the connection information

func (*ConnectionInfo) AddResource

func (c *ConnectionInfo) AddResource(device ControllerObject, resource string, res_type string)

type ConnectionObject

type ConnectionObject struct {
	Metadata ObjectMetaData `json:"metadata"`
	Info     ConnectionInfo `json:"information"`
}

func NewConnectionObject

func NewConnectionObject(end1 ConnectionEnd, end2 ConnectionEnd) ConnectionObject

func (*ConnectionObject) GetMetadata

func (c *ConnectionObject) GetMetadata() ObjectMetaData

func (*ConnectionObject) GetPeer

func (c *ConnectionObject) GetPeer(t string, n string) (string, string, string)

func (*ConnectionObject) GetType

func (c *ConnectionObject) GetType() string

type ConnectionResource

type ConnectionResource struct {
	ConnObject string `json:"-"`
	Name       string `json:"-"`
	Type       string `json:"-"`
}

type ControllerObject

type ControllerObject interface {
	GetMetadata() ObjectMetaData
	GetType() string
}

ControllerObject define the basic functionality of ControllerObject

type DeviceObject

type DeviceObject struct {
	Metadata      ObjectMetaData     `json:"metadata"`
	Specification DeviceObjectSpec   `json:"spec"`
	Status        DeviceObjectStatus `json:"status"`
}

App contains metadata for Apps

func (*DeviceObject) GetCertName

func (c *DeviceObject) GetCertName() string

func (*DeviceObject) GetMetadata

func (c *DeviceObject) GetMetadata() ObjectMetaData

func (*DeviceObject) GetType

func (c *DeviceObject) GetType() string

func (*DeviceObject) IsProxyHub

func (c *DeviceObject) IsProxyHub(hub_name string) bool

type DeviceObjectSpec

type DeviceObjectSpec struct {
	PublicIps            []string     `json:"publicIps"`
	ForceHubConnectivity bool         `json:"forceHubConnectivity"`
	ProxyHub             string       `json:"proxyHub"`
	ProxyHubPort         int          `json:"proxyHubPort"`
	UseHub4Internet      bool         `json:"useHub4Internet"`
	DedicatedSFC         bool         `json:"dedicatedSFC"`
	CertificateId        string       `json:"certificateId"`
	KubeConfig           string       `json:"kubeConfig" encrypted:""`
	GitOpsParam          GitOpsParams `json:"gitOpsParam"`
}

DeviceObjectSpec contains the parameters

type DeviceObjectStatus

type DeviceObjectStatus struct {
	// 1: use public ip 2: use hub as proxy
	Mode int
	// ip used for external connection
	// if Mode=1, ip is one of public ip
	// if Mode=2, ip is the OIP allocated by SCC
	Ip string
	// DataIps saves the overlay ips assigned for different traffic tunnel
	DataIps map[string]string
	// Status Data
	Data         map[string]string
	DelegatedHub string
}

DeviceObjectStatus

type EmptyObject

type EmptyObject struct {
	Metadata ObjectMetaData `json:"metadata"`
}

App contains metadata for Apps

func (*EmptyObject) GetMetadata

func (c *EmptyObject) GetMetadata() ObjectMetaData

func (*EmptyObject) GetType

func (c *EmptyObject) GetType() string

type GitOpsParams

type GitOpsParams struct {
	GitOpsType            string `json:"gitOpsType"`
	GitOpsReferenceObject string `json:"gitOpsReferenceObject"`
	GitOpsResourceObject  string `json:"gitOpsResourceObject"`
}

type HubDeviceObject

type HubDeviceObject struct {
	Metadata      ObjectMetaData      `json:"metadata"`
	Specification HubDeviceObjectSpec `json:"spec"`
}

App contains metadata for Apps

func (*HubDeviceObject) GetMetadata

func (c *HubDeviceObject) GetMetadata() ObjectMetaData

func (*HubDeviceObject) GetType

func (c *HubDeviceObject) GetType() string

type HubDeviceObjectSpec

type HubDeviceObjectSpec struct {
	Device        string `json:"device"`
	IsDelegateHub bool   `json:"isDelegateHub"`
}

HubDeviceObjectSpec contains the parameters

type HubObject

type HubObject struct {
	Metadata      ObjectMetaData  `json:"metadata"`
	Specification HubObjectSpec   `json:"spec"`
	Status        HubObjectStatus `json:"-"`
}

App contains metadata for Apps

func (*HubObject) GetCertName

func (c *HubObject) GetCertName() string

func (*HubObject) GetMetadata

func (c *HubObject) GetMetadata() ObjectMetaData

func (*HubObject) GetType

func (c *HubObject) GetType() string

type HubObjectSpec

type HubObjectSpec struct {
	PublicIps     []string     `json:"publicIps"`
	CertificateId string       `json:"certificateId"`
	KubeConfig    string       `json:"kubeConfig" encrypted:""`
	GitOpsParam   GitOpsParams `json:"gitOpsParam"`
}

HubObjectSpec contains the parameters

type HubObjectStatus

type HubObjectStatus struct {
	Ip   string
	Data map[string]string
	// Devices that this hub delegates
	DelegateDevices []string
}

HubObjectStatus

type IPRangeObject

type IPRangeObject struct {
	Metadata      ObjectMetaData      `json:"metadata"`
	Specification IPRangeObjectSpec   `json:"spec"`
	Status        IPRangeObjectStatus `json:"-"`
}

App contains metadata for Apps

func (*IPRangeObject) Allocate

func (c *IPRangeObject) Allocate(name string) (string, error)

func (*IPRangeObject) Free

func (c *IPRangeObject) Free(sip string) error

func (*IPRangeObject) FreeAll

func (c *IPRangeObject) FreeAll() error

func (*IPRangeObject) GetMetadata

func (c *IPRangeObject) GetMetadata() ObjectMetaData

func (*IPRangeObject) GetType

func (c *IPRangeObject) GetType() string

func (*IPRangeObject) InUsed

func (c *IPRangeObject) InUsed() bool

func (*IPRangeObject) IsConflict

func (c *IPRangeObject) IsConflict(o *IPRangeObject) bool

type IPRangeObjectSpec

type IPRangeObjectSpec struct {
	Subnet string `json:"subnet" validate:"required,ipv4"`
	MinIp  int    `json:"minIp" validate:"gte=1,lte=255"`
	MaxIp  int    `json:"maxIp" validate:"gte=1,lte=255"`
}

IPRangeObjectSpec contains the parameters

type IPRangeObjectStatus

type IPRangeObjectStatus struct {
	Masks [32]byte
	Data  map[string]string
}

type ObjectBuilder

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

func GetObjectBuilder

func GetObjectBuilder() *ObjectBuilder

func (*ObjectBuilder) Register

func (c *ObjectBuilder) Register(name string, r interface{})

func (*ObjectBuilder) ToObject

func (c *ObjectBuilder) ToObject(obj_str string) (ControllerObject, error)

func (*ObjectBuilder) ToString

func (c *ObjectBuilder) ToString(obj ControllerObject) (string, error)

type ObjectMetaData

type ObjectMetaData struct {
	Name        string `json:"name" validate:"required,hostname_rfc1123"`
	Description string `json:"description"`
	UserData1   string `json:"userData1"`
	UserData2   string `json:"userData2"`
}

ObjectMetaData contains the parameters

type OverlayObject

type OverlayObject struct {
	Metadata      ObjectMetaData    `json:"metadata"`
	Specification OverlayObjectSpec `json:"spec"`
}

App contains metadata for Apps

func (*OverlayObject) GetMetadata

func (c *OverlayObject) GetMetadata() ObjectMetaData

func (*OverlayObject) GetType

func (c *OverlayObject) GetType() string

type OverlayObjectSpec

type OverlayObjectSpec struct {
}

OverlayObjectSpec contains the parameters

type ProposalObject

type ProposalObject struct {
	Metadata      ObjectMetaData     `json:"metadata"`
	Specification ProposalObjectSpec `json:"spec"`
}

App contains metadata for Apps

func (*ProposalObject) GetMetadata

func (c *ProposalObject) GetMetadata() ObjectMetaData

func (*ProposalObject) GetType

func (c *ProposalObject) GetType() string

func (*ProposalObject) ToResource

func (c *ProposalObject) ToResource() *resource.ProposalResource

type ProposalObjectSpec

type ProposalObjectSpec struct {
	Encryption string `json:"encryption"`
	Hash       string `json:"hash"`
	DhGroup    string `json:"dhGroup"`
}

ProposalObjectSpec contains the parameters

type ResourceObject

type ResourceObject struct {
	Metadata      ObjectMetaData     `json:"metadata"`
	Specification ResourceObjectSpec `json:"spec"`
}

App contains metadata for Apps

func (*ResourceObject) GetMetadata

func (c *ResourceObject) GetMetadata() ObjectMetaData

func (*ResourceObject) GetType

func (c *ResourceObject) GetType() string

type ResourceObjectSpec

type ResourceObjectSpec struct {
	Hash      string `json:"hash"`
	Ref       int    `json:"ref"`
	ContextId string `json:"cid"`
	Status    string `json:"status"`
}

ResourceObjectSpec contains the parameters

type SiteObject

type SiteObject struct {
	Metadata      ObjectMetaData `json:"metadata"`
	Specification SiteObjectSpec `json:"spec"`
}

App contains metadata for Apps

func (*SiteObject) GetMetadata

func (c *SiteObject) GetMetadata() ObjectMetaData

func (*SiteObject) GetType

func (c *SiteObject) GetType() string

type SiteObjectSpec

type SiteObjectSpec struct {
	Hubs   []string `json:"hubs"`
	Url    string   `json:"url"`
	Subnet string   `json:"subnet"`
}

SiteObjectSpec contains the parameters

Jump to

Keyboard shortcuts

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