actions

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor interface {
	RunAction(ctx context.Context, value string) error
	Description() string
}

func FuncActor

func FuncActor(description string, actor func(ctx context.Context, value string) error) Actor

type Option

type Option func(s *Server)

Option is a function that applies a configuration to the server.

func WithLogger

func WithLogger(l goka.Logger) Option

WithLogger sets the logger to use. By default, it logs to the standard library logger.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is a provides HTTP routes for querying the group table.

func NewServer

func NewServer(basePath string, router *mux.Router, opts ...Option) *Server

NewServer creates a server with the given options.

func (*Server) AttachAction

func (s *Server) AttachAction(name string, actor Actor) error

AttachSource attaches a new source to the query server.

func (*Server) AttachFuncAction

func (s *Server) AttachFuncAction(name string, description string, actor func(ctx context.Context, value string) error) error

func (*Server) BasePath

func (s *Server) BasePath() string

Jump to

Keyboard shortcuts

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