Documentation
¶
Index ¶
- func NewCommApi(install gore.IGService, obj any) *commapi
- type BufferConfig
- type GeneralResponse
- func (g *GeneralResponse) Any(data any) *GeneralResponse
- func (g *GeneralResponse) Err(err error) *GeneralResponse
- func (g *GeneralResponse) Error(msg string) *GeneralResponse
- func (g *GeneralResponse) Ok(msg string) *GeneralResponse
- func (g *GeneralResponse) Response(code int, msg string) *GeneralResponse
- func (g *GeneralResponse) Sucess(msg string, data any) *GeneralResponse
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCommApi ¶
Types ¶
type BufferConfig ¶
type BufferConfig struct {
Addr string `json:"addr"`
Port int `json:"port"`
User string `json:"user"`
Token string `json:"token"`
Comment string `json:"comment,omitempty"`
Ports []any `json:"ports,omitempty"`
Domains []string `json:"domains,omitempty"`
Subdomains []string `json:"subdomains,omitempty"`
}
func (*BufferConfig) ParsePorts ¶
func (u *BufferConfig) ParsePorts() []int
type GeneralResponse ¶
type GeneralResponse struct {
Code int `json:"code"`
Msg string `json:"msg"`
Data any `json:"data"`
Raw []byte `json:"-"`
}
func Response ¶
func Response(r *http.Request) (*GeneralResponse, func(w http.ResponseWriter))
func (*GeneralResponse) Any ¶
func (g *GeneralResponse) Any(data any) *GeneralResponse
func (*GeneralResponse) Err ¶
func (g *GeneralResponse) Err(err error) *GeneralResponse
func (*GeneralResponse) Error ¶
func (g *GeneralResponse) Error(msg string) *GeneralResponse
func (*GeneralResponse) Ok ¶
func (g *GeneralResponse) Ok(msg string) *GeneralResponse
func (*GeneralResponse) Response ¶
func (g *GeneralResponse) Response(code int, msg string) *GeneralResponse
func (*GeneralResponse) Sucess ¶
func (g *GeneralResponse) Sucess(msg string, data any) *GeneralResponse
Click to show internal directories.
Click to hide internal directories.