starter

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: MIT Imports: 2 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 (
	KindGRPC Kind = "gRPC"
	KindWEB  Kind = "WEB"
)

定义一套运输种类

type Server

type Server interface {
	Endpoint() (string, error)
	Start() error
	Stop() error
}

Server 是启动机服务器.

type Starter

type Starter struct {
	Kind Kind
}

Starter 是启动机上下文值.

func FromContext

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

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

Directories

Path Synopsis
web

Jump to

Keyboard shortcuts

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