service

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Close added in v0.2.2

type Close interface {
	Close()
}

type Command added in v0.2.0

type Command interface {
	Command() *cli.Command
	Start() error
	Stop() error
}

type Flags added in v0.2.2

type Flags interface {
	Flags() []cli.Flag
}

type HandlerFunc

type HandlerFunc func(ctx context.Context, req Request, resp Response) error

type Init added in v0.2.2

type Init interface {
	Init()
}

type Middleware

type Middleware func(next HandlerFunc) HandlerFunc

type Options

type Options struct {
	Id        string            `json:"id,omitempty"`
	Name      string            `json:"name,omitempty"`
	Version   string            `json:"version,omitempty"`
	Port      int               `json:"port,omitempty"`
	Addr      string            `json:"addr,omitempty"`
	Advertise string            `json:"advertise,omitempty"`
	Metadata  map[string]string `json:"metadata,omitempty"`
}

type Request

type Request interface {
	// Client server or client
	Client() bool

	// Kind [http|grpc...]
	Kind() string

	// Stream Indicates whether it's a stream
	Stream() bool

	// Service name requested
	Service() string

	// Operation requested
	Operation() string

	// Endpoint requested
	Endpoint() string

	// ContentType Content type provided
	ContentType() string

	// Header of the request
	Header() *RequestHeader

	// Payload is the decoded value
	Payload() interface{}
}

Request is a synchronous request interface

type RequestHeader added in v0.2.4

type RequestHeader = fasthttp.RequestHeader

type Response

type Response interface {
	Header() *ResponseHeader
	Payload() interface{}
	Stream() bool
}

Response is the response writer for un encoded messages

type ResponseHeader added in v0.2.4

type ResponseHeader = fasthttp.ResponseHeader

type Router added in v0.2.4

type Router func(app *fiber.App)

type Service

type Service interface {
	grpc.ServiceRegistrar
	Command
	Options() Options
	Provider(provider interface{})
	SubCmd(cmd *cli.Command)
}

type Web added in v0.2.1

type Web interface {
	Command
	Options() Options
	Provider(provider interface{})
	SubCmd(cmd *cli.Command)
}

type WebApp added in v0.2.4

type WebApp struct {
	*fiber.App
}

type WebHandler added in v0.2.2

type WebHandler interface {
	Router(r fiber.Router)
}

Jump to

Keyboard shortcuts

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