schema

package
v0.0.0-...-36ab9e0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorItem

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

type ErrorResponse

type ErrorResponse struct {
	Code       int    `json:"code"`
	Message    string `json:"message"`
	StatusCode int    `json:"status_code"`
}

type ErrorResult

type ErrorResult struct {
	Error ErrorItem `json:"error"`
}

type ListResult

type ListResult struct {
	List       interface{}         `json:"list"`
	Pagination *PaginationResponse `json:"pagination,omitempty"`
}

type PaginationParam

type PaginationParam struct {
	Current  int `query:"current,default=1"`
	PageSize int `query:"page_size,default=10"`
}

func (*PaginationParam) GetCurrent

func (a *PaginationParam) GetCurrent() int

func (*PaginationParam) GetPageSize

func (a *PaginationParam) GetPageSize() int

type PaginationResponse

type PaginationResponse struct {
	Total    int `json:"total"`
	Current  int `json:"current"`
	PageSize int `json:"page_size"`
}

func (*PaginationResponse) NewPaginationResponse

func (r *PaginationResponse) NewPaginationResponse(total int, current int, pageSize int) PaginationResponse

type StatusResult

type StatusResult struct {
	Status StatusText `json:"status"`
}

type StatusText

type StatusText string
const (
	OKStatus    StatusText = "success"
	ErrorStatus StatusText = "Error"
	FailStatus  StatusText = "Fail"
)

func (StatusText) String

func (t StatusText) String() string

type ThreatsPage

type ThreatsPage struct {
	List       []*ent.Threat       `json:"list"`
	Pagination *PaginationResponse `json:"pagnition"`
}

type ThreatsResponse

type ThreatsResponse struct {
	Code       int         `json:"code"`
	Message    string      `json:"message"`
	StatusCode int         `json:"status_code"`
	Data       ThreatsPage `json:"data"`
}

Jump to

Keyboard shortcuts

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