externalserver

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenericServerProviderFn

type GenericServerProviderFn[T any, U any] func(context.Context, *T) (*U, error)

GenericServerProviderFn generic function that implements ServerProviderFn interface

func (GenericServerProviderFn[T, U]) Call

func (fn GenericServerProviderFn[T, U]) Call(request *restful.Request, response *restful.Response)

Call handle rest call for given request

type Server

type Server struct {
	Fns       map[string]ServerProviderFn
	Container *restful.Container

	Addr     string
	TLS      bool
	CertFile string
	KeyFile  string
}

Server the external provider server

func NewServer

func NewServer(path string, fns map[string]ServerProviderFn) *Server

NewServer create a server for serving as cuex external

func (*Server) AddFlags

func (in *Server) AddFlags(set *pflag.FlagSet)

AddFlags set flags

func (*Server) ListenAndServe

func (in *Server) ListenAndServe() (err error)

ListenAndServe start the server

func (*Server) NewCommand

func (in *Server) NewCommand() *cobra.Command

NewCommand create start command

type ServerProviderFn

type ServerProviderFn interface {
	Call(request *restful.Request, response *restful.Response)
}

ServerProviderFn the function interface to process rest call

Jump to

Keyboard shortcuts

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