starter

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(ctx context.Context, tr Starter) context.Context

NewContext 返回一个带有值的新Context.

Types

type Kind

type Kind string

Kind 定义启动机类型

const (
	KindRPC Kind = "RPC"
	KindWEB Kind = "WEB"
)

定义一套运输种类

type Server

type Server interface {
	Endpoint() (*url.URL, error)
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
}

Server 是启动机服务器.

type Starter

type Starter struct {
	Kind     Kind
	Endpoint string
}

Starter 是启动机上下文值.

func FromContext

func FromContext(ctx context.Context) (tr Starter, ok bool)

FromContext 返回存储在ctx中的传输值(如果有).

Directories

Path Synopsis
rpc
web

Jump to

Keyboard shortcuts

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