module

package
v0.1.89 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: MIT Imports: 5 Imported by: 39

README

Tinysystems module

Collection of structs and interfaces to be used by module implementations

Documentation

Index

Constants

View Source
const (
	//ReconcilePort target port. Useful when component wants refresh its look in cluster, triggers reconcile for the node
	ReconcilePort = "_reconcile"
	//ControlPort dashboard
	ControlPort = "_control"
	// SettingsPort settings page
	SettingsPort = "_settings"

	//NodePort source port. Received tinynode object
	NodePort = "_node"

	ClientPort = "_client"
)

system ports

Variables

This section is empty.

Functions

func GetNodeFullName

func GetNodeFullName(prefix string, module string, component string) string

func ParseFullName

func ParseFullName(fullName string) (module string, component string, err error)

Types

type Client added in v0.1.69

type Client interface {
	ExposePort(ctx context.Context, autoHostName string, hostnames []string, port int) ([]string, error)
	DisclosePort(ctx context.Context, port int) error
}

type Component

type Component interface {
	GetInfo() ComponentInfo
	//Handle handles incoming requests
	Handle(ctx context.Context, output Handler, port string, message interface{}) error
	//Ports gets list of ports
	Ports() []Port
	//Instance creates new instance with default settings
	Instance() Component
}

type ComponentInfo

type ComponentInfo struct {
	Name        string
	Description string
	Info        string
	Tags        []string
}

func (ComponentInfo) GetResourceName

func (c ComponentInfo) GetResourceName() string

type Handler

type Handler func(ctx context.Context, port string, data interface{}) error

type Info

type Info struct {
	Name      string
	VersionID string // if module's build is registered
	Version   string
	Addr      string //listed address
}

func (Info) GetMajorName

func (i Info) GetMajorName() string

func (Info) GetMajorNameSanitised

func (i Info) GetMajorNameSanitised() string

func (Info) GetNameAndVersion added in v0.1.31

func (i Info) GetNameAndVersion() string

GetNameAndVersion Container image full name

type Port added in v0.1.69

type Port struct {
	// if that's a source port, source means it accepts the data, the source of incoming data
	Source bool
	// which side of the node will have this port
	Position Position
	// Name lower case programmatic name
	Name string
	// Human readable name (capital cased)
	Label string
	// DTO object
	Configuration interface{}
}

type Position

type Position int
const (
	Top Position = iota
	Right
	Bottom
	Left
)

Jump to

Keyboard shortcuts

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