service_inter

package
v0.1.27 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Desc

type Desc struct {
	grpc.ServiceDesc
	Handler       interface{}
	GrpcClientFn  interface{}
	GrpcGatewayFn interface{}
}

type Handler

type Handler interface {
	Close()
	Init()
	Flags() typex.Flags
	Router(r fiber.Router)
}

type HandlerFunc

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

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"`
	Address   string            `json:"address,omitempty"`
	Advertise string            `json:"advertise"`
	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() metadata.MD

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

Request is a synchronous request interface

type Response

type Response interface {
	Header() metadata.MD
	Payload() interface{}
	Stream() bool
}

Response is the response writer for un encoded messages

Jump to

Keyboard shortcuts

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