server

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DirektivActionIDHeader = "Direktiv-ActionID"
	DirektivTempDir        = "Direktiv-TempDir"

	DirektivErrorCodeHeader    = "Direktiv-ErrorCode"
	DirektivErrorMessageHeader = "Direktiv-ErrorMessage"

	DirektivErrorCode = "io.direktiv.error.execution"
)

Variables

This section is empty.

Functions

func Handler

func Handler[IN any](fn func(context.Context, IN, *ExecutionInfo) (interface{}, error)) http.Handler

nolint

Types

type ExecutionInfo

type ExecutionInfo struct {
	TmpDir string
	Log    *Logger
}

type File

type File struct {
	Name       string `json:"name"`
	Content    string `json:"content"`
	Permission uint   `json:"permission"`
}

type Logger

type Logger struct {
	// httpLogEnabled, binaryLogEnabled bool
	LogData bytes.Buffer
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(actionID string) *Logger

func (*Logger) Log

func (l *Logger) Log(format string, args ...any)

nolint

func (*Logger) SetWriterState

func (l *Logger) SetWriterState(enable bool)

func (*Logger) Write

func (l *Logger) Write(p []byte) (int, error)

type Payload

type Payload[DATA any] struct {
	Files []File `json:"files"`
	Data  DATA   `json:"data"`
}

type Server

type Server[IN any] struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer[IN any](fn func(context.Context, IN, *ExecutionInfo) (interface{}, error)) *Server[IN]

nolint

func (*Server[IN]) Start

func (s *Server[IN]) Start()

func (*Server[IN]) Stop

func (s *Server[IN]) Stop()

nolint

Jump to

Keyboard shortcuts

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