micro

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEndpoint added in v0.0.12

func AddEndpoint(subject string, group micro.Group, fn Handler, opts ...EndpointOption) error

func UUIDMapper

func UUIDMapper(t reflect.Type) []reflect.StructField

Types

type ContextFunc added in v0.0.12

type ContextFunc func(context.Context, string, micro.Headers) context.Context

type DecoderFunc added in v0.0.12

type DecoderFunc func(b []byte) (any, error)

type EncoderFunc added in v0.0.12

type EncoderFunc func(v any) ([]byte, error)

type EndpointAttacher

type EndpointAttacher func(context.Context, micro.Group) error

type EndpointAttacherSet added in v0.0.8

type EndpointAttacherSet []EndpointAttacher

func (EndpointAttacherSet) Endpoints added in v0.0.8

func (e EndpointAttacherSet) Endpoints() []EndpointAttacher

type EndpointOption added in v0.0.12

type EndpointOption func(*endpointOpts) error

func WithContext

func WithContext(ctx context.Context) EndpointOption

func WithContextFn added in v0.0.12

func WithContextFn(fn ContextFunc) EndpointOption

func WithDecoderFn added in v0.0.12

func WithDecoderFn(fn DecoderFunc) EndpointOption

func WithEncoderFn added in v0.0.12

func WithEncoderFn(fn EncoderFunc) EndpointOption

func WithErrFn added in v0.0.12

func WithErrFn(fn ErrorFunc) EndpointOption

func WithJsonSchema added in v0.0.12

func WithJsonSchema(reflector jsonschema.Reflector, req interface{}, res interface{}) EndpointOption

func WithMiddlewares added in v0.0.12

func WithMiddlewares(mws ...Middleware) EndpointOption

func WithTimeout added in v0.0.12

func WithTimeout(t time.Duration) EndpointOption

type Endpointer

type Endpointer interface {
	Endpoints() []EndpointAttacher
}

type ErrorFunc added in v0.0.12

type ErrorFunc func(err error) (string, string, []byte, micro.Headers)

type Handler added in v0.0.12

type Handler func(ctx context.Context, req any) (any, error)

type Middleware added in v0.0.12

type Middleware func(Handler) Handler

type Schema added in v0.0.12

type Schema struct {
	Request  string `json:"request"`
	Response string `json:"response"`
}

func GenerateJsonSchema added in v0.0.12

func GenerateJsonSchema(reflector jsonschema.Reflector, req interface{}, res interface{}) (*Schema, error)

Jump to

Keyboard shortcuts

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