rest

package
v0.0.0-...-f79bcc6 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host       string `yaml:"host"`
	Port       int    `yaml:"port"`
	DebugModel bool   `yaml:"debugModel"`
	Name       string `yaml:"name"`
}

type RestReply

type RestReply struct {
	Code      int         `json:"code"`
	Reason    string      `json:"reason"`
	Msg       string      `json:"msg"`
	TraceId   string      `json:"traceId"`
	Timestamp int64       `json:"timestamp"`
	Data      interface{} `json:"data"`
}

RestReply http 导出

type Server

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

func New

func New(cfg *Config, bizCtx *biz.SampleBiz) (instance *Server, err error)

func (*Server) CreateUser

func (s *Server) CreateUser(c *gin.Context)

func (*Server) MockError

func (s *Server) MockError(c *gin.Context)

func (*Server) Name

func (s *Server) Name() string

func (*Server) Ping

func (s *Server) Ping(c *gin.Context)

func (*Server) Run

func (s *Server) Run(ctx context.Context) (err error)

func (*Server) Stop

func (s *Server) Stop()

type ValidatorStruct

type ValidatorStruct interface {
	Validate() error
}

Jump to

Keyboard shortcuts

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