dacranepdk

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

README

dacrane-pdk

Plugin Development Kit for Dacrane

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecPluginJob

func ExecPluginJob(plugin Plugin)

func MapToFunc

func MapToFunc[T any](m map[string]T) func(string) (T, bool)

Types

type Data

type Data struct {
	Get func(parameters any, meta PluginMeta) (any, error)
}

type Log

type Log func(string)

type Plugin

type Plugin struct {
	Config    PluginConfig
	Resources func(string) (Resource, bool)
	Data      func(string) (Data, bool)
}

type PluginConfig

type PluginConfig struct {
	DockerHost *string
	WorkingDir string
}

func NewDefaultPluginConfig

func NewDefaultPluginConfig() PluginConfig

type PluginMeta

type PluginMeta struct {
	CustomStateDir string
	Log            Log
}

func NewPluginMeta

func NewPluginMeta(customStateDir string) PluginMeta

type Resource

type Resource struct {
	Create func(parameter any, meta PluginMeta) (any, error)
	Update func(current any, previous any, meta PluginMeta) (any, error)
	Delete func(parameter any, meta PluginMeta) error
}

Jump to

Keyboard shortcuts

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