app

package
Version: v0.0.2-alpha.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2021 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App interface {
	Init(...Option)
	Options() Options
	Name() string

	// a App can contains multiple clients
	Client(string) client.Client

	// a App contain only one server
	Server() server.Server

	Run() error
	String() string
}

func NewApp

func NewApp(opts ...Option) App

type Option

type Option func(*Options)

func Client

func Client(c ...client.Client) Option

func Context

func Context(ctx context.Context) Option

func Registry

func Registry(r registry.Registry) Option

func Router

func Router(r router.Router) Option

func Server

func Server(s server.Server) Option

func Transport

func Transport(t transport.Transport) Option

type Options

type Options struct {

	////
	// Sink into client/server, when client/server dose not have these options
	Registry  registry.Registry
	Transport transport.Transport
	Router    router.Router

	Server server.Server

	// To be optimized: map or array
	Clients []client.Client

	Context context.Context
}

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL