responses

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2019 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteResourceStatusResponse

func WriteResourceStatusResponse(code int, resource string, action string, err string, w http.ResponseWriter)

Types

type AuthEnabledResponse

type AuthEnabledResponse struct {
	Enabled bool `json:"enabled"`
}

AuthEnabledResponse is the response body for the authEnabled endpoint swagger:model AuthEnabledResponse

type ChartCreationBody

type ChartCreationBody struct {
	// in:body
	Data models.Chart `json:"data"`
}

ChartCreationBody is the body needed to create a chart through rest swagger:parameters CreateChart UpdateChart

type ConfigCreationBody

type ConfigCreationBody struct {
	//in:body
	Data models.Config `json:"data"`
}

ConfigCreationBody is the body that is needed to create a new Config through rest swagger:parameters CreateConfig UpdateConfig

type LogFileCreationBody

type LogFileCreationBody struct {
	// in:body
	Data struct {
		// required
		UUID string `json:"uuid" validate:"uuid"`
		Name string `json:"name" validate:"required"`
		Note string `json:"note"`
	} `json:"data"`
}

LogFileCreationBody is a model for creating logfiles through rest This is used to validate the update request swagger:parameters UpdateLogFile CreateLogFile

type LogFileResponse

type LogFileResponse struct {
	UUID      string `json:"uuid"`
	Name      string `json:"name"`
	Timestamp int64  `json:"timestamp"`
	Note      string `json:"note"`
	Log       string `json:"log"`
}

LogFileResponse is a single logFile response model

This is used for returning a response with a single order as body

swagger:response LogFileResponse

func GenerateLogResponse

func GenerateLogResponse(logFile *models.LogFile, env *utils.Env) *LogFileResponse

GenerateLogResponse returns a new LogFileResponse filled with the actual note and log data

type LoginParameters

type LoginParameters struct {
	Username   string `json:"username" validate:"required"`
	Password   string `json:"password" validate:"required"`
	RememberMe bool   `json:"rememberMe"`
}

LoginParameters is the body that is needed to login the user swagger:parameters Login

type LoginSuccess

type LoginSuccess struct {
	Data struct {
		Token string `json:"token"`
	}
}

LoginSuccess is successful loggingresponse

This is used for returning the new JWT token to to the user

swagger:model LoginSuccessResponse

type ResourceStatusResponse

type ResourceStatusResponse struct {
	// in: body
	Body struct {
		Code     int    `json:"code"`
		Resource string `json:"resource"`
		Action   string `json:"action"`
		Error    string `json:"error"`
	} `json:"body"`
}

A error or success response model This is used to indicate errors or success messages

swagger:response ResourceStatusResponse

type SheetCreationBody

type SheetCreationBody struct {
	//in:body
	Data models.Sheet `json:"data"`
}

SheetCreationBody is the body that is needed to create a new sheet through rest swagger:parameters CreateSheet UpdateSheet

type SheetResponse

type SheetResponse struct {
	UUID   string         `json:"uuid"`
	Title  string         `json:"title"`
	Charts []models.Chart `json:"charts"`
}

SheetResponse is a single logFile response model

This is used for returning a response with a single sheet object as body

swagger:model SheetResponse

func GenerateSheetResponseObject

func GenerateSheetResponseObject(sheet *models.Sheet, env *utils.Env) *SheetResponse

GenerateSheetResponseObject returns a SheetResponse object filled with actual chart data instead of id

type UidPathParam

type UidPathParam struct {
	// in: path
	UUID string `json:"uuid"`
}

type UserCreationBody

type UserCreationBody struct {
	// in:body
	Data models.User `json:"data"`
}

UserCreationBody is the body needed to create a user through rest swagger:parameters CreateUser UpdateUser

type WorkspaceCreationBody

type WorkspaceCreationBody struct {
	//in:body
	Data models.Workspace
}

WorkspaceCreationBody is a body that is needed to create workspaces through rest Parameters needed to create a sheet object swagger:parameters CreateWorkspace UpdateWorkspace

type WorkspaceResponse

type WorkspaceResponse struct {
	UUID   string           `json:"uuid"`
	Title  string           `json:"title"`
	Sheets []*SheetResponse `json:"sheets"`
}

WorkspaceResponse is a single logFile response model

This is used for returning a response with a single sheet object as body

swagger:model WorkspaceResponse

func GenerateWorkspaceResponseObject

func GenerateWorkspaceResponseObject(workspace *models.Workspace, env *utils.Env) *WorkspaceResponse

GenerateWorkspaceResponseObject returns a WorkSpaceResponse object filled with actual sheet and chart data instead of id

Jump to

Keyboard shortcuts

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