Documentation
¶
Index ¶
- func AddError(err error)
- func SaveConfig()
- type Config
- type TypeController
- func (c *TypeController) AddError(err error)
- func (c *TypeController) ClearError()
- func (c *TypeController) DeleteError(context *gin.Context)
- func (c *TypeController) DeleteNeighbor(ctx *gin.Context)
- func (c *TypeController) Error(ctx *gin.Context)
- func (c *TypeController) GetError() *utils.Errors
- func (c *TypeController) GetNeighbor(context *gin.Context)
- func (c *TypeController) GetNeighborInfo(ctx *gin.Context)
- func (c *TypeController) LoadConfig()
- func (c *TypeController) PutNeighbor(ctx *gin.Context)
- func (c *TypeController) Start()
- func (c *TypeController) StatusRegister(fn func())
- func (c *TypeController) Stop()
- func (c *TypeController) UpdateCCVMInfo() TypeNeighborInfos
- func (c *TypeController) UpdateNeighborInfo() TypeNeighborInfos
- type TypeNeighbor
- type TypeNeighborInfo
- type TypeNeighborInfos
- type TypeNeighbors
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
func (*TypeNeighbor) GetFromNeighbor ¶
func (n *TypeNeighbor) GetFromNeighbor(api string) (map[string]interface{}, int)
type TypeNeighborInfo ¶
type TypeNeighborInfos ¶
type TypeNeighborInfos struct {
Neighbors map[string]TypeNeighborInfo `json:"neighbors"`
}
type TypeNeighbors ¶
type TypeNeighbors struct {
Neighbors []TypeNeighbor `json:"neighbors"`
}
Click to show internal directories.
Click to hide internal directories.