micro

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTokenContextKey = "X-MicroWeb-Token"
View Source
const EnvLocal = "local"

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientWrapper

type ClientWrapper interface {
	ListEnvs() []string
	ListServices(env string) ([]*registry.Service, error)
	GetService(env, name string) (*registry.Service, error)
	Call(ctx context.Context, env, service, endpoint string, body map[string]interface{}, resp *json.RawMessage) error
}

type LocalClient

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

func NewLocalClient

func NewLocalClient(microClient client.Client, microRegistry registry.Registry, requestTimeout time.Duration) LocalClient

func (LocalClient) Call

func (c LocalClient) Call(ctx context.Context, env, service, endpoint string, body map[string]interface{}, response *json.RawMessage) error

func (LocalClient) GetService

func (c LocalClient) GetService(env, name string) (*registry.Service, error)

func (LocalClient) ListEnvs

func (c LocalClient) ListEnvs() []string

func (LocalClient) ListServices

func (c LocalClient) ListServices(env string) ([]*registry.Service, error)

type MultiWebClient

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

func NewMultiWebClient

func NewMultiWebClient(envs map[string]string) MultiWebClient

func (MultiWebClient) Call

func (c MultiWebClient) Call(ctx context.Context, env, service, endpoint string, body map[string]interface{}, response *json.RawMessage) error

func (MultiWebClient) GetService

func (c MultiWebClient) GetService(env, name string) (*registry.Service, error)

func (MultiWebClient) ListEnvs

func (c MultiWebClient) ListEnvs() []string

func (MultiWebClient) ListServices

func (c MultiWebClient) ListServices(env string) ([]*registry.Service, error)

type WebClient

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

func NewWebClient

func NewWebClient(baseUri, tokenContextKey string) WebClient

func (*WebClient) Call

func (c *WebClient) Call(ctx context.Context, req client.Request, rsp interface{}, _ ...client.CallOption) error

func (*WebClient) GetService

func (c *WebClient) GetService(ctx context.Context, name string) (*registry.Service, error)

func (*WebClient) Init

func (c *WebClient) Init(...client.Option) error

func (*WebClient) ListServices

func (c *WebClient) ListServices(ctx context.Context) ([]*registry.Service, error)

func (*WebClient) NewMessage

func (c *WebClient) NewMessage(topic string, msg interface{}, opts ...client.MessageOption) client.Message

func (*WebClient) NewRequest

func (c *WebClient) NewRequest(service, endpoint string, req interface{}, reqOpts ...client.RequestOption) client.Request

func (*WebClient) Options

func (c *WebClient) Options() client.Options

func (*WebClient) Publish

func (*WebClient) Stream

func (*WebClient) String

func (c *WebClient) String() string

Jump to

Keyboard shortcuts

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