controllers

package
v0.0.0-...-44acadb Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

generated code - do not edit

generated code - do not edit

generated code - do not edit

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(r *gin.Engine)

Types

type ContentID

type ContentID struct {
	// The ID of the order
	//
	// in: path
	// required: true
	ID int64
}

An ContentID parameter model.

This is used for operations that want the ID of an order in the path swagger:parameters getContent updateContent deleteContent

type ContentInput

type ContentInput struct {
	// The Content to submit or modify
	// in: body
	Content *orm.ContentAPI
}

ContentInput is a schema that can validate the user’s input to prevent us from getting invalid data swagger:parameters postContent updateContent

type Controller

type Controller struct {

	// Map_BackRepos is the map to the backRepo instance according to the stack instance path
	Map_BackRepos map[string]*gongmarkdown_orm.BackRepoStruct
	// contains filtered or unexported fields
}

A Controller is the handler of all API REST calls matching the stack model It forwards API requests to the stack instance identified by the GONG_StackPath parameters in the request the stack instance is the BackRepo instance

func GetController

func GetController() *Controller

func (*Controller) AddBackRepo

func (controller *Controller) AddBackRepo(backRepo *gongmarkdown_orm.BackRepoStruct, stackPath string)

func (*Controller) DeleteContent

func (controller *Controller) DeleteContent(c *gin.Context)

DeleteContent

swagger:route DELETE /contents/{ID} contents deleteContent

Delete a content

default: genericError

200: contentDBResponse

func (*Controller) GetContent

func (controller *Controller) GetContent(c *gin.Context)

GetContent

swagger:route GET /contents/{ID} contents getContent

Gets the details for a content.

Responses: default: genericError

200: contentDBResponse

func (*Controller) GetContents

func (controller *Controller) GetContents(c *gin.Context)

GetContents

swagger:route GET /contents contents getContents

Get all contents

Responses: default: genericError

200: contentDBResponse

func (*Controller) GetLastCommitFromBackNb

func (controller *Controller) GetLastCommitFromBackNb(c *gin.Context)

swagger:route GET /commitfrombacknb backrepo GetLastCommitFromBackNb

func (*Controller) GetLastPushFromFrontNb

func (controller *Controller) GetLastPushFromFrontNb(c *gin.Context)

swagger:route GET /pushfromfrontnb backrepo GetLastPushFromFrontNb

func (*Controller) PostContent

func (controller *Controller) PostContent(c *gin.Context)

PostContent

swagger:route POST /contents contents postContent

Creates a content

Consumes:
- application/json

Produces:
- application/json

Responses:
  200: nodeDBResponse

func (*Controller) UpdateContent

func (controller *Controller) UpdateContent(c *gin.Context)

UpdateContent

swagger:route PATCH /contents/{ID} contents updateContent

Update a content

Responses: default: genericError

200: contentDBResponse

type GenericError

type GenericError struct {
	// in: body
	Body struct {
		Code    int32  `json:"code"`
		Message string `json:"message"`
	} `json:"body"`
}

A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures.

swagger:response genericError

type ValidationError

type ValidationError struct {
	// in: body
	Body struct {
		Code    int32  `json:"code"`
		Message string `json:"message"`
		Field   string `json:"field"`
	} `json:"body"`
}

A ValidationError is an that is generated for validation failures. It has the same fields as a generic error but adds a Field property.

swagger:response validationError

Jump to

Keyboard shortcuts

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