service

package
v0.0.0-...-33f8601 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RequestHeader

type RequestHeader struct {
	Session string
	Request http.Request
}

RequestHeader 默认请求头.

func (RequestHeader) String

func (h RequestHeader) String() string

String session id.

type ResponseHeader

type ResponseHeader struct {
	Status  int
	Message string `json:",omitempty"`
}

ResponseHeader 默认返回头.

func (*ResponseHeader) InternalError

func (h *ResponseHeader) InternalError(format string, argv ...interface{})

InternalError 返回因为内部错误导致的异常信息(500).

func (*ResponseHeader) InvalidRequest

func (h *ResponseHeader) InvalidRequest(format string, argv ...interface{})

InvalidRequest 返回因为请求参数错误导致的异常信息(400).

func (*ResponseHeader) SetError

func (h *ResponseHeader) SetError(status int, format string, argv ...interface{})

SetError 返回错误信息.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service 一个服务对象.

func New

func New() *Service

New 返回service对象.

func (*Service) Init

func (s *Service) Init()

Init 解析flag参数, 初始化基本信息.

func (*Service) Register

func (s *Service) Register(obj interface{}) error

Register 注册接口.

func (*Service) Start

func (s *Service) Start()

Start 开启服务.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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