server

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileExist

func FileExist(name string) bool

Types

type Args

type Args struct {
	Port int32
	// Kubeconfig  is absolute path to the kubeconfig file
	Kubeconfig string
}

type DeleteRecord

type DeleteRecord struct {
	IP     string `json:"ip"`
	Domain string `json:"domain" binding:"required"`
}

DeleteRecord for DeleteRecords function

type Record

type Record struct {
	IP     string `json:"ip" binding:"required"`
	Domain string `json:"domain" binding:"required"`
}

Record for PostRecords function

type Response

type Response struct {
	// 统一状态码,成功=0 失败>0
	Code    int         `json:"code"`
	Data    interface{} `json:"data"`
	Message string      `json:"message"`
}

func ErrorResponse

func ErrorResponse(err error) *Response

func SuccessResponse

func SuccessResponse(data interface{}, msg string) *Response

SuccessResponse for success response

type Server

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

func NewServer

func NewServer(args Args) (*Server, error)

func (*Server) Run

func (s *Server) Run(stop chan struct{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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