flag

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadFlag

func LoadFlag() gin.HandlerFunc

func RegisterRouter

func RegisterRouter(g *gin.RouterGroup)

Types

type Handler

type Handler struct {
}

func (*Handler) BatchDelete

func (*Handler) BatchDelete() gin.HandlerFunc

func (*Handler) Create

func (*Handler) Create() gin.HandlerFunc

func (*Handler) List

func (*Handler) List() gin.HandlerFunc

func (*Handler) Modify

func (*Handler) Modify() gin.HandlerFunc

func (*Handler) Show

func (*Handler) Show() gin.HandlerFunc

func (*Handler) SingleDelete

func (*Handler) SingleDelete() gin.HandlerFunc

type RFlag

type RFlag struct {
	Type     string      `json:"type"`
	Settings interface{} `json:"settings"`
}

func BindFlag

func BindFlag(flag *cpt.Flag) *RFlag

func BindList

func BindList(flags []cpt.Flag) []*RFlag

type ReqBatchDelete

type ReqBatchDelete struct {
	Orders []int `json:"orders"`
}

type ReqCreate

type ReqCreate struct {
	Type     string      `json:"type" validate:"required" binding:"required"`
	Settings interface{} `json:"settings"`
}

type ReqModify

type ReqModify struct {
	Type     *string     `json:"type" validate:"omitempty,min=1" binding:"omitempty,min=1"`
	Settings interface{} `json:"settings"`
}

func (*ReqModify) Bind

func (r *ReqModify) Bind(f *cpt.Flag) (err error)

type RespBatchDelete

type RespBatchDelete struct {
	Response
	Details []*RespBatchDeleteDetail `json:"details"`
}

type RespBatchDeleteDetail

type RespBatchDeleteDetail struct {
	Response
	OldOrder int `json:"old_order"`
}

type RespCreate

type RespCreate struct {
	Response
	FlagOrder int `json:"flag_order,omitempty"`
}

type RespList

type RespList struct {
	Response
	Flags []*RFlag `json:"flags"`
}

type RespShow

type RespShow struct {
	Response
	Flag *RFlag `json:"flag"`
}

Jump to

Keyboard shortcuts

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