api

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MonitorCommands = struct {
	LoadRootConfig         string
	CreateTopics           string
	LoadProcessorEndpoints string
	InitializeProcessors   string
	RunProcessors          string
	Load                   string
	CatProcessor           string
}{
	LoadRootConfig:         "loadRootConfig",
	CreateTopics:           "createTopics",
	LoadProcessorEndpoints: "loadProcessorEndpoints",
	InitializeProcessors:   "initializeProcessors",
	RunProcessors:          "runProcessors",
	Load:                   "load",
	CatProcessor:           "catProcessor",
}
View Source
var ProcessorCommands = struct {
	Initialize string
	Run        string
	Exit       string
	Ping       string
	Cat        string
}{
	Initialize: "initialize",
	Run:        "run",
	Exit:       "exit",
	Ping:       "ping",
	Cat:        "cat",
}
View Source
var ResponseCodes = struct {
	Success int
	Failed  int
}{
	Success: 0,
	Failed:  1,
}

Functions

func MarshalToParams

func MarshalToParams(s any) (map[string]any, error)

func MonitorHandle

func MonitorHandle(w http.ResponseWriter, r *http.Request)

func NewInvokerRequestParams

func NewInvokerRequestParams() map[string]any

func ProcessorHandle

func ProcessorHandle(w http.ResponseWriter, r *http.Request, pc *models.ProcessorCallbacks)

func UnmarshalParams

func UnmarshalParams(params map[string]any, dest any) error

Types

type CatProcessorParams

type CatProcessorParams struct {
	ProcessorName string `json:"processorName"`
}

type InvokerClient

type InvokerClient struct {
	Cli *http.Client
	Url string
}

func (*InvokerClient) SendCommand

func (c *InvokerClient) SendCommand(params map[string]any, command string) (*InvokerResponse, error)

func (*InvokerClient) SendFile

func (c *InvokerClient) SendFile(fileName string, file io.Reader) (*InvokerResponse, error)

type InvokerRequest

type InvokerRequest struct {
	Command string         `json:"command"`
	Params  map[string]any `json:"params"`
}

type InvokerResponse

type InvokerResponse struct {
	Code     int    `json:"code"`
	Message  string `json:"message"`
	HostName string `json:"host_name"`
}

type LoadParams

type LoadParams struct {
	Name   string   `json:"name"`
	Url    string   `json:"url"`
	Topics []string `json:"topics"`
}

type LoadProcessorEndpointsParams

type LoadProcessorEndpointsParams struct {
	Endpoints []string `json:"endpoints"`
}

type ProcessorCatResult

type ProcessorCatResult map[string][]StateStoreEntry

type ProcessorClient

type ProcessorClient struct {
	InvokerClient

	ProcessorName string
}

func NewProcessorClient

func NewProcessorClient(processorName, url string) *ProcessorClient

func (*ProcessorClient) Cat

func (pc *ProcessorClient) Cat() (*InvokerResponse, error)

func (*ProcessorClient) Initialize

func (pc *ProcessorClient) Initialize() (*InvokerResponse, error)

func (*ProcessorClient) Run

func (pc *ProcessorClient) Run() (*InvokerResponse, error)

type ProcessorMetadata

type ProcessorMetadata struct {
	Name   string
	Status string
	Client *ProcessorClient
}

type StateStoreEntry

type StateStoreEntry struct {
	Key string `json:"key"`
	Val string `json:"val"`
}

Jump to

Keyboard shortcuts

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