controller

package
v0.0.0-...-b9b9f84 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddError

func AddError(err error)

func SaveConfig

func SaveConfig()

Types

type Config

type Config struct {
	Neighbor []TypeNeighbor `json:"neighbor"`
}

type TypeController

type TypeController struct {
	Handlers []func() `json:"handlers"`

	Neighbor *TypeNeighbors `json:"neighbors"`

	Cube *Cube.TypeCUBE       `json:"cube"`
	Mold *Mold.TypeMoldStatus `json:"mold_status"`
	Glue *Glue.TypeGlueStatus `json:"glue_status"`
	// contains filtered or unexported fields

} //	@name	TypeController

func Init

func Init() *TypeController

func (*TypeController) AddError

func (c *TypeController) AddError(err error)

func (*TypeController) ClearError

func (c *TypeController) ClearError()

func (*TypeController) DeleteError

func (c *TypeController) DeleteError(context *gin.Context)

func (*TypeController) DeleteNeighbor

func (c *TypeController) DeleteNeighbor(ctx *gin.Context)

DeleteNeighbor godoc

@Summary		DeleteNeighbor
@Description	DeleteNeighbor.
@Tags			API, CUBE
@Accept			x-www-form-urlencoded
@Produce		json
@Param			ip			formData	string	true	"Neighbor IP"
@Param			hostname	formData	string	true	"Neighbor Hostname"
@Success		200			{object}	TypeNeighbor
@Failure		400			{object}	HTTP400BadRequest
@Failure		404			{object}	HTTP404NotFound
@Failure		500			{object}	HTTP500InternalServerError
@Router			/neighbor [delete]

func (*TypeController) Error

func (c *TypeController) Error(ctx *gin.Context)

Error godoc

@Summary		Error
@Description	Error.
@Tags			API, CUBE
@Accept			x-www-form-urlencoded
@Produce		json
@Success		200	{object}	utils.Errorlog
@Failure		400	{object}	HTTP400BadRequest
@Failure		404	{object}	HTTP404NotFound
@Failure		500	{object}	HTTP500InternalServerError
@Router			/err [get]

func (*TypeController) GetError

func (c *TypeController) GetError() *utils.Errors

func (*TypeController) GetNeighbor

func (c *TypeController) GetNeighbor(context *gin.Context)

GetNeighbor godoc

@Summary		GetNeighbor
@Description	GetNeighbor.
@Tags			API, CUBE
@Accept			x-www-form-urlencoded
@Produce		json
@Success		200	{object}	TypeNeighbors
@Failure		400	{object}	HTTP400BadRequest
@Failure		404	{object}	HTTP404NotFound
@Failure		500	{object}	HTTP500InternalServerError
@Router			/neighbor [get]

func (*TypeController) GetNeighborInfo

func (c *TypeController) GetNeighborInfo(ctx *gin.Context)

GetNeighborInfo godoc

@Summary		GetNeighbor
@Description	GetNeighbor.
@Tags			API, CUBE
@Accept			x-www-form-urlencoded
@Produce		json
@Success		200	{object}	TypeNeighborInfos
@Failure		400	{object}	HTTP400BadRequest
@Failure		404	{object}	HTTP404NotFound
@Failure		500	{object}	HTTP500InternalServerError
@Router			/neighbor/info [get]

func (*TypeController) LoadConfig

func (c *TypeController) LoadConfig()

func (*TypeController) PutNeighbor

func (c *TypeController) PutNeighbor(ctx *gin.Context)

PutNeighbor godoc

@Summary		PutNeighbor
@Description	PutNeighbor.
@Tags			API, CUBE
@Accept			x-www-form-urlencoded
@Produce		json
@Param			ip			formData	string	true	"Neighbor IP"
@Param			hostname	formData	string	true	"Neighbor Hostname"
@Success		200			{object}	TypeNeighbors
@Failure		400			{object}	HTTP400BadRequest
@Failure		404			{object}	HTTP404NotFound
@Failure		500			{object}	HTTP500InternalServerError
@Router			/neighbor [post]
@Router			/neighbor [put]

func (*TypeController) Start

func (c *TypeController) Start()

func (*TypeController) StatusRegister

func (c *TypeController) StatusRegister(fn func())

func (*TypeController) Stop

func (c *TypeController) Stop()

func (*TypeController) UpdateCCVMInfo

func (c *TypeController) UpdateCCVMInfo() TypeNeighborInfos

func (*TypeController) UpdateNeighborInfo

func (c *TypeController) UpdateNeighborInfo() TypeNeighborInfos

type TypeNeighbor

type TypeNeighbor struct {
	IP       string `json:"ip"`
	HostName string `json:"hostname"`
}

func (*TypeNeighbor) GetFromNeighbor

func (n *TypeNeighbor) GetFromNeighbor(api string) (map[string]interface{}, int)

type TypeNeighborInfo

type TypeNeighborInfo struct {
	Info map[string]interface{} `json:"info"`
	Code int                    `json:"code"`
}

type TypeNeighborInfos

type TypeNeighborInfos struct {
	Neighbors map[string]TypeNeighborInfo `json:"neighbors"`
}

type TypeNeighbors

type TypeNeighbors struct {
	Neighbors []TypeNeighbor `json:"neighbors"`
}

Jump to

Keyboard shortcuts

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