client

package
v1.0.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const CALL_FUNC_IS_NULL = "create service: The CallFunc cannot be empty~"
View Source
const NAME_IS_NULL = "create service: The ServiceName cannot be empty!"

Variables

This section is empty.

Functions

func Create

func Create(opts ...Option) (interface{}, error)

Types

type CallFuncParams

type CallFuncParams struct {
	Ctx     context.Context
	Service micro.Service
	Input   interface{}
}

type Option

type Option func(opts *Options)

func CallFunc

func CallFunc(fn func(CallFuncParams) (interface{}, error)) Option

func Ctx

func Ctx(c context.Context) Option

func Hystrix

func Hystrix(h []string) Option

func Init

func Init(options []micro.Option) Option

func Input

func Input(i interface{}) Option

func Name

func Name(name string) Option

func SetOption

func SetOption(k, v interface{}) Option

type Options

type Options struct {
	// use for client context set option
	Context context.Context

	// handler context
	Ctx context.Context

	// ps : []string{"sing.DemoService.SayHello"}
	Hystrix []string

	// CallFunc additional parameters
	Input interface{}

	Name     string
	Init     []micro.Option
	CallFunc func(CallFuncParams) (interface{}, error)
}

Jump to

Keyboard shortcuts

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