api

package
v0.0.0-...-fef60ef Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrCodeUnableParseRequest = 1
	ErrCodeUnableCheckIP      = 2
	ErrCodeEmptyParam         = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AbfAPI

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

AbfAPI service api.

func NewAbfAPI

func NewAbfAPI(cfg config.AppConfig, logger *zap.Logger) (*AbfAPI, error)

NewAbfAPI new instance of AbfAPI.

func (*AbfAPI) Run

func (a *AbfAPI) Run(ctx context.Context)

Run run service api.

type AllowResult

type AllowResult struct {
	CanAuth   bool `json:"can-auth"`
	Login     bool `json:"login-check"`
	Pwd       bool `json:"pwd-check"`
	IP        bool `json:"ip-check"`
	Whitelist bool `json:"whitelist-check"`
	Blacklist bool `json:"blacklist-check"`
}

func (*AllowResult) Build

func (a *AllowResult) Build()

type ErrorResponse

type ErrorResponse struct {
	ErrMessage string `json:"error"`
	Code       int    `json:"code"`
}

func (ErrorResponse) JSON

func (s ErrorResponse) JSON() string

type SuccessOK

type SuccessOK struct {
	Status string `json:"status"`
}

func NewSuccessOK

func NewSuccessOK() SuccessOK

type SuccessResponse

type SuccessResponse struct {
	Result interface{} `json:"result"`
	Code   int         `json:"code"`
}

func (SuccessResponse) JSON

func (s SuccessResponse) JSON() string

Jump to

Keyboard shortcuts

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