service

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bar

type Bar interface {
	// use @{annotation name} comment if you want to generate proxy code
	// @proxy
	Logic(needEmitErr bool) (string, error)

	// also support multiple annotation
	// proxy middleware runs in order of annotation
	// @custom1
	// @custom2
	Foo() int
}

func NewBar

func NewBar() Bar

type BarProxy

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

implement proxy for Bar

func NewBarProxy

func NewBarProxy(target Bar, middlewares map[string][]func(func(context.Context) error) func(context.Context) error) *BarProxy

func (*BarProxy) Foo

func (p *BarProxy) Foo() int

func (*BarProxy) Logic

func (p *BarProxy) Logic(needEmitErr bool) (string, error)

type BarProxyMiddleware

type BarProxyMiddleware func(func(context.Context) error) func(context.Context) error

helper for BarProxy middleware

type BarProxyMiddlewareByAnnotation

type BarProxyMiddlewareByAnnotation map[string]BarProxyMiddlewares

helper for BarProxy middleware map about middlewares by aannotation

func (BarProxyMiddlewareByAnnotation) To

convert BarProxy middleware map to raw type

type BarProxyMiddlewares

type BarProxyMiddlewares []BarProxyMiddleware

func (BarProxyMiddlewares) To

func (a BarProxyMiddlewares) To() []func(func(context.Context) error) func(context.Context) error

convert BarProxy middleware to raw type

type Foo

type Foo interface {
	// use @{annotation name} comment if you want to generate proxy code
	// @proxy
	Logic(needEmitErr bool) (string, error)

	// also support multiple annotation
	// proxy middleware runs in order of annotation
	// @custom1
	// @custom2
	Foo() int
}

func NewFoo

func NewFoo() Foo

type FooProxy

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

implement proxy for Foo

func NewFooProxy

func NewFooProxy(target Foo, middlewares map[string][]func(func(context.Context) error) func(context.Context) error) *FooProxy

func (*FooProxy) Foo

func (p *FooProxy) Foo() int

func (*FooProxy) Logic

func (p *FooProxy) Logic(needEmitErr bool) (string, error)

type FooProxyMiddleware

type FooProxyMiddleware func(func(context.Context) error) func(context.Context) error

helper for FooProxy middleware

type FooProxyMiddlewareByAnnotation

type FooProxyMiddlewareByAnnotation map[string]FooProxyMiddlewares

helper for FooProxy middleware map about middlewares by aannotation

func (FooProxyMiddlewareByAnnotation) To

convert FooProxy middleware map to raw type

type FooProxyMiddlewares

type FooProxyMiddlewares []FooProxyMiddleware

func (FooProxyMiddlewares) To

func (a FooProxyMiddlewares) To() []func(func(context.Context) error) func(context.Context) error

convert FooProxy middleware to raw type

Jump to

Keyboard shortcuts

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