endpoint

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DescribeEndpointRequest

type DescribeEndpointRequest struct {
	Name string
}

DescribeEndpointRequest todo

type Endpoint

type Endpoint struct {
	ID           string     `bson:"_id" json:"id" validate:"required,lte=64"`                    // 端点名称
	CreateAt     ftime.Time `bson:"create_at" json:"create_at,omitempty"`                        // 创建时间
	UpdateAt     ftime.Time `bson:"update_at" json:"update_at,omitempty"`                        // 更新时间
	Service      string     `bson:"service" json:"service,omitempty" validate:"required,lte=64"` // 该功能属于那个服务
	Version      string     `bson:"version" json:"version,omitempty" validate:"required,lte=64"` // 服务那个版本的功能
	router.Entry `bson:",inline"`
}

Endpoint Service's features

func NewDefaultEndpoint

func NewDefaultEndpoint() *Endpoint

NewDefaultEndpoint todo

func (*Endpoint) GenID

func (e *Endpoint) GenID()

GenID hash id

func (*Endpoint) LabelsToStr

func (e *Endpoint) LabelsToStr() string

LabelsToStr 扁平化标签 action:get;action:list;action-list-echo

func (*Endpoint) ParseLabels

func (e *Endpoint) ParseLabels(labels string) error

ParseLabels 解析Str格式的label

type QueryEndpointRequest

type QueryEndpointRequest struct {
	*request.PageRequest
}

QueryEndpointRequest 查询应用列表

func NewQueryEndpointRequest

func NewQueryEndpointRequest(pageReq *request.PageRequest) *QueryEndpointRequest

NewQueryEndpointRequest 列表查询请求

type RegistryRequest

type RegistryRequest struct {
	*token.Session
	Version string          `json:"version" validate:"required,lte=32"`
	Entries []*router.Entry `json:"entries"`
}

RegistryRequest 服务注册请求

func NewDefaultRegistryRequest

func NewDefaultRegistryRequest() *RegistryRequest

NewDefaultRegistryRequest todo

func NewRegistryRequest

func NewRegistryRequest(version string, entries []*router.Entry) *RegistryRequest

NewRegistryRequest 注册请求

func (*RegistryRequest) Endpoints

func (req *RegistryRequest) Endpoints() []*Endpoint

Endpoints 功能列表

func (*RegistryRequest) Validate

func (req *RegistryRequest) Validate() error

Validate 校验注册请求合法性

type Service

type Service interface {
	QueryEndpoints(req *QueryEndpointRequest) (*Set, error)
	Registry(req *RegistryRequest) error
}

Service token管理服务

type Set

type Set struct {
	*request.PageRequest

	Total int64       `json:"total"`
	Items []*Endpoint `json:"items"`
}

Set 列表

func NewEndpointSet

func NewEndpointSet(req *request.PageRequest) *Set

NewEndpointSet 实例化

func (*Set) Add

func (s *Set) Add(e *Endpoint)

Add 添加

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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