rest

package
v0.0.0-...-7a5fecb Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APIPrefix is the common prefix of all apis.
	APIPrefix = "/api/v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Err

type Err struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

Err is the error format for all apis.

func NewErr

func NewErr(code int, message string) *Err

NewErr creates an error.

func (*Err) Error

func (e *Err) Error() string

type Server

type Server struct {
	Service *service.Service
	// contains filtered or unexported fields
}

Server is the HTTP API server.

func New

func New(cfg *service.ServiceConfig) *Server

New creates an API server.

func (*Server) ServerForever

func (s *Server) ServerForever(port int)

func (*Server) Shutdown

func (s *Server) Shutdown()

Shutdown closes the Server.

Jump to

Keyboard shortcuts

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