Help us shape the future of Go! Take the 2026 Go Developer Survey

integration

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: ISC Imports: 5 Imported by: 0

README

Integration SDK

Here you'll find the SDKs for all Plakar integrations.

Documentation

Index

Constants

View Source
const (
	ResourceClassUndefined     ResourceClass = ""
	ResourceClassUnknown       ResourceClass = "unknown"
	ResourceClassAnalytics     ResourceClass = "analytics"
	ResourceClassBlockStorage  ResourceClass = "block-storage"
	ResourceClassCompute       ResourceClass = "compute"
	ResourceClassDatabase      ResourceClass = "database"
	ResourceClassFileStorage   ResourceClass = "file-storage"
	ResourceClassHypervisor    ResourceClass = "hypervisor"
	ResourceClassIdentity      ResourceClass = "identity"
	ResourceClassMessaging     ResourceClass = "messaging"
	ResourceClassNetwork       ResourceClass = "network"
	ResourceClassObjectStorage ResourceClass = "object-storage"
	ResourceClassObservability ResourceClass = "observability"
	ResourceClassRegistry      ResourceClass = "registry"
	ResourceClassSecurity      ResourceClass = "security"
	ResourceClassService       ResourceClass = "service"

	ResourceSubClassUndefined     ResourceSubClass = ""
	ResourceSubClassUnknown       ResourceSubClass = "unknown"
	ResourceSubClassAzBlob        ResourceSubClass = "azblob"
	ResourceSubClassFTP           ResourceSubClass = "ftp"
	ResourceSubClassGCS           ResourceSubClass = "gcs"
	ResourceSubClassIMAP          ResourceSubClass = "imap"
	ResourceSubClassMongoDB       ResourceSubClass = "mongodb"
	ResourceSubClassMySQL         ResourceSubClass = "mysql"
	ResourceSubClassPVC           ResourceSubClass = "pvc"
	ResourceSubClassPostgreSQL    ResourceSubClass = "postgresql"
	ResourceSubClassProxmox       ResourceSubClass = "proxmox"
	ResourceSubClassRedis         ResourceSubClass = "redis"
	ResourceSubClassS3            ResourceSubClass = "s3"
	ResourceSubClassSecretManager ResourceSubClass = "secret-manager"
	ResourceSubClassSFTP          ResourceSubClass = "sftp"
	ResourceSubClassVMware        ResourceSubClass = "vmware"

	ConnectorTypeImporter       ConnectorType = "importer"
	ConnectorTypeExporter       ConnectorType = "exporter"
	ConnectorTypeStorage        ConnectorType = "storage"
	ConnectorTypeSecretProvider ConnectorType = "secret_provider"
	ConnectorTypeInventory      ConnectorType = "inventory"
)

Variables

View Source
var (
	ErrInvalidEndpoint     = errors.New("invalid endpoint")
	ErrConnectorMismatch   = errors.New("cannot update connector type")
	ErrUnknownEndpointType = errors.New("unknown endpoint type")
	ErrDisabledSync        = errors.New("disabled sync")
)

Functions

func GetClassTree

func GetClassTree() map[ResourceClass][]ResourceSubClass

Types

type ConnectorType

type ConnectorType string

func (ConnectorType) IsValid

func (c ConnectorType) IsValid() bool

type Country

type Country string

Country is where a resource physically sits, as an ISO 3166-1 alpha-2 code. It is an observation, not a rule: whether data is allowed to be there is the control plane's question, not the integration's.

Empty means we cannot tell -- correct for an SFTP host or a local filesystem. It never means "same as the inventory": nothing is inferred from anything else.

func CountryOf

func CountryOf(code string) Country

CountryOf normalizes a code, returning "" for anything that is not one. Use it on the way out so an unmapped region becomes "unknown" rather than a bad code.

The shape is checked rather than the code looked up in a list of countries: that list changes, and an integration somewhere we have not heard of should not wait for an SDK release.

type EndpointType

type EndpointType string
const (
	EndpointUndefined  EndpointType = ""
	EndpointHost       EndpointType = "host"
	EndpointInet4      EndpointType = "inet4"
	EndpointInet6      EndpointType = "inet6"
	EndpointUUID       EndpointType = "uuid"
	EndpointNetwork    EndpointType = "network"
	EndpointIdentifier EndpointType = "identifier"
)

func EndpointTypeFromString

func EndpointTypeFromString(t string) (EndpointType, error)

type HostEndpoint

type HostEndpoint struct {
	Type       EndpointType
	Endpoint   string
	Attributes map[string]string
}

type Inventory

type Inventory interface {
	List(context.Context, chan<- *InventoryEntry) error
	Close(context.Context) error
}

type InventoryEntry

type InventoryEntry struct {
	Class    ResourceClass    // interpreted
	SubClass ResourceSubClass // interpreted
	Tags     []string         // <value>, <key>=<value>

	// The rest is provider data
	URN       string //
	Name      string //
	Region    string // eu-west-3, paris/dc-1, ...
	Service   string // s3, ec2, instance, dedicated-server, ...
	Resource  string // s3:bucket, ec2:volume, ...
	Details   []byte // Additional backend-specific content
	Endpoints []HostEndpoint

	// Fill via CountryOf. Report it on every entry you can.
	Country Country
}

type ResourceClass

type ResourceClass string

func (ResourceClass) IsValid

func (c ResourceClass) IsValid() bool

type ResourceSubClass

type ResourceSubClass string

func (ResourceSubClass) IsSubClassOf

func (c ResourceSubClass) IsSubClassOf(parent ResourceClass) bool

func (ResourceSubClass) IsValid

func (c ResourceSubClass) IsValid() bool

type SecretProvider

type SecretProvider interface {
	Ping(ctx context.Context) error
	Resolve(ctx context.Context, handle string) (secret string, err error)
	Close(ctx context.Context) error
}

Directories

Path Synopsis
cmd
inventory-run command
secret-run command
cmd/rot13 command
Package stdioconn provides a net.Conn over a pair of files, such as the standard input and output of a process or the pipes to a child.
Package stdioconn provides a net.Conn over a pair of files, such as the standard input and output of a process or the pipes to a child.

Jump to

Keyboard shortcuts

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