controllers

package
v0.0.0-...-4f57c4f Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationController

type ApplicationController struct {
	// contains filtered or unexported fields
}

ApplicationController for general application functions

func NewApplicationController

func NewApplicationController(
	ctx *utils.Context) *ApplicationController

NewApplicationController creates a new app controller instance

func (*ApplicationController) BadRequest

func (ac *ApplicationController) BadRequest(w http.ResponseWriter,
	err error)

BadRequest sends an error for badly formed requests to the client

func (*ApplicationController) DefaultResponse

func (ac *ApplicationController) DefaultResponse(w http.ResponseWriter,
	result interface{}, err error)

DefaultResponse returns a bad request error to the client or a formatted JSON output.

func (*ApplicationController) ErrorOutput

func (ac *ApplicationController) ErrorOutput(w http.ResponseWriter,
	result ErrorResponse)

ErrorOutput writes a error response to the client

func (*ApplicationController) InternalError

func (ac *ApplicationController) InternalError(w http.ResponseWriter,
	err error)

InternalError sends an error for server errors to the client

func (*ApplicationController) Output

func (ac *ApplicationController) Output(w http.ResponseWriter,
	result interface{})

Output marshals a struct into JSON format for output

type DirectoryController

type DirectoryController struct {
	ApplicationController
	// contains filtered or unexported fields
}

DirectoryController is for handling directory actions

func NewDirectoryController

func NewDirectoryController(ctx *utils.Context) *DirectoryController

NewDirectoryController returns a new controller instance

func (*DirectoryController) AtTime

AtTime handles requests for a directory listing at a given time

func (*DirectoryController) Compare

func (dc *DirectoryController) Compare(w http.ResponseWriter,
	r *http.Request)

Compare handles requests for comparing directory states at different times

func (*DirectoryController) Register

func (dc *DirectoryController) Register(router *mux.Router)

Register registers the directory endpoint with the router

func (*DirectoryController) Show

Show handles requests for showing a directory listing

type ErrorResponse

type ErrorResponse struct {
	Code  int
	Error string
}

ErrorResponse contains error information for the client

type FileController

type FileController struct {
	ApplicationController
	// contains filtered or unexported fields
}

FileController is for handling file actions

func NewFileController

func NewFileController(ctx *utils.Context) *FileController

NewFileController returns a new controller instance

func (*FileController) AtTime

func (fc *FileController) AtTime(w http.ResponseWriter,
	r *http.Request)

AtTime handles requests for getting a file version at a point in time.

func (*FileController) History

func (fc *FileController) History(w http.ResponseWriter,
	r *http.Request)

History handles requests for showing file version history.

func (*FileController) Register

func (fc *FileController) Register(router *mux.Router)

Register registers the file endpoint with the router

func (*FileController) Show

func (fc *FileController) Show(w http.ResponseWriter,
	r *http.Request)

Show handles requests for showing file information

Jump to

Keyboard shortcuts

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