api

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostAPI

func NewPostAPI(opts ...service.OptionFunc) (service.Service, error)

NewPostAPI new api service

func NewService

func NewService(opts ...service.OptionFunc) (service.Service, error)

NewService new api service

func RegistUseFuncs

func RegistUseFuncs(name string, fn gin.HandlerFunc) error

RegistUseFuncs 注册

Types

type API

type API struct {
	ID             string `xorm:"id"`
	Name           string `xorm:"name"`
	ServiceName    string `xorm:"service_name"`
	ServiceVersion string `xorm:"service_version"`
	Topic          string `xorm:"topic"`
	Status         string `xorm:"status"`
	Version        int64  `xorm:"version"`
}

API api struct

func (*API) TableName

func (*API) TableName() string

TableName database table name

type PostAPI

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

PostAPI api service

func (*PostAPI) Route

func (p *PostAPI) Route(string) service.HandlerFunc

Route 路由

func (*PostAPI) Start

func (p *PostAPI) Start() error

Start start service

func (*PostAPI) Stop

func (p *PostAPI) Stop() error

Stop stop service

type Response

type Response struct {
	TraceID   string      `json:"trace_id"`
	TraceIP   string      `json:"trace_ip"`
	Host      string      `json:"host"`
	Code      uint64      `json:"code"`
	Namespace string      `json:"namespace,omitempty"`
	Msg       string      `json:"msg,omitempty"`
	Result    interface{} `json:"result"`
}

Response response

type Service

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

Service api service

func (*Service) Route

func (p *Service) Route(string) service.HandlerFunc

Route 路由

func (*Service) Start

func (p *Service) Start() error

Start start service

func (*Service) Stop

func (p *Service) Stop() error

Stop stop service

Jump to

Keyboard shortcuts

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