srv

package
v0.0.0-...-07069d5 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SERVICE_LRUCACHE = "lrucache"
	SERVICE_REDIS    = "redis"
	SERVICE_OSS      = "oss"
	SERVICE_URI      = "uv-uri"
)
View Source
const (
	ERRNO_OK              = 200
	ERRNO_NOT_FOUND       = 404
	ERRNO_INTERNAL_SERVER = 500
)

Variables

This section is empty.

Functions

func Reg

func Reg(s *G.Server)

Types

type URIItem

type URIItem struct {
	URI string `json:"uri"`
	IID int64  `json:"iid"`
}

func (*URIItem) Key

func (U *URIItem) Key() string

type URIService

type URIService struct {
	Prefix   string   `json:"prefix"`
	BasePath string   `json:"basePath"`
	Aid      int64    `json:"aid"`     //区域ID
	Nid      int64    `json:"nid"`     //节点ID
	Expires  int64    `json:"expires"` //过期秒数
	IID      *iid.IID `json:"-"`
	// contains filtered or unexported fields
}

func GetURIService

func GetURIService(ctx micro.Context, name string) (*URIService, error)

func (*URIService) Config

func (s *URIService) Config() interface{}

* * 服务配置 *

func (*URIService) Name

func (s *URIService) Name() string

* * 服务名称 *

func (*URIService) OnInit

func (s *URIService) OnInit(ctx micro.Context) error

* * 初始化服务 *

func (*URIService) OnValid

func (s *URIService) OnValid(ctx micro.Context) error

* * 校验服务是否可用 *

func (*URIService) Recycle

func (s *URIService) Recycle()

Jump to

Keyboard shortcuts

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