handler

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DataTypeResource = "resource"
	DataTypeEmail    = "email"
	DataTypeTelegram = "telegram"
	DataTypeWebhook  = "webhook"
	DataTypeBackup   = "backup"
)

handler data types

Variables

View Source
var (
	ErrReQueue = errors.New("requeue")
)

Functions

func HasTypePrefixOf

func HasTypePrefixOf(parameter interface{}, expectedType string) (cmap.CustomMap, bool)

func IsTypeOf

func IsTypeOf(parameter interface{}, expectedType string) (cmap.CustomMap, bool)

Types

type BackupData

type BackupData struct {
	Type         string `json:"type" yaml:"type"`
	ProviderType string `json:"providerType" yaml:"providerType"`
}

BackupData struct

type Config

type Config struct {
	ID          string               `json:"id" yaml:"id"`
	Description string               `json:"description" yaml:"description"`
	Enabled     bool                 `json:"enabled" yaml:"enabled"`
	Labels      cmap.CustomStringMap `json:"labels" yaml:"labels"`
	Type        string               `json:"type" yaml:"type"`
	Spec        cmap.CustomMap       `json:"spec" yaml:"spec"`
	ModifiedOn  time.Time            `json:"modifiedOn" yaml:"modifiedOn"`
	State       *types.State         `json:"state" yaml:"state"`
}

Config struct

func (*Config) Clone

func (hdr *Config) Clone() Config

Clone config

type EmailData

type EmailData struct {
	Disabled string   `json:"disabled" yaml:"disabled"`
	Type     string   `json:"type" yaml:"type"`
	From     string   `json:"from" yaml:"from"`
	To       []string `json:"to" yaml:"to"`
	Subject  string   `json:"subject" yaml:"subject"`
	Body     string   `json:"body" yaml:"body"`
}

EmailData struct

type MessageWrapper

type MessageWrapper struct {
	ID   string
	Data map[string]interface{}
}

used in bus specially used to send data to handlers

type Plugin

type Plugin interface {
	Name() string
	Start() error
	Close() error
	Post(parameters map[string]interface{}) error
	State() *types.State
}

Plugin interface details for operation

type ResourceData

type ResourceData struct {
	Disabled     string               `json:"disabled" yaml:"disabled"`
	Type         string               `json:"type" yaml:"type"`
	ResourceType string               `json:"resourceType" yaml:"resourceType"`
	QuickID      string               `json:"quickId" yaml:"quickId"`
	Labels       cmap.CustomStringMap `json:"labels" yaml:"labels"`
	Payload      string               `json:"payload" yaml:"payload"`
	PreDelay     string               `json:"preDelay" yaml:"preDelay"`
	KeyPath      string               `json:"keyPath" yaml:"keyPath"`
}

ResourceData struct

type StringData

type StringData struct {
	Disabled string `json:"disabled" yaml:"disabled"`
	Type     string `json:"type" yaml:"type"`
	Value    string `json:"value" yaml:"value"`
}

simple string data

type TelegramData

type TelegramData struct {
	Disabled  string   `json:"disabled" yaml:"disabled"`
	Type      string   `json:"type" yaml:"type"`
	ChatIDs   []string `json:"chatIds" yaml:"chatIds"`
	ParseMode string   `json:"parseMode" yaml:"parseMode"`
	Text      string   `json:"text" yaml:"text"`
}

TelegramData struct

type WebhookData

type WebhookData struct {
	Disabled        string                 `json:"disabled" yaml:"disabled"`
	Type            string                 `json:"type" yaml:"type"`
	Server          string                 `json:"server" yaml:"server"`
	API             string                 `json:"api" yaml:"api"`
	Insecure        bool                   `json:"insecure" yaml:"insecure"`
	Method          string                 `json:"method" yaml:"method"`
	Headers         map[string]string      `json:"headers" yaml:"headers"`
	QueryParameters map[string]interface{} `json:"queryParameters" yaml:"queryParameters"`
	Data            interface{}            `json:"data" yaml:"data"`
	CustomData      bool                   `json:"customData" yaml:"customData"`
	ResponseCode    int                    `json:"responseCode" yaml:"responseCode"`
}

WebhookData struct

Jump to

Keyboard shortcuts

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