controllers

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Arc is an API server for your secrets.

Schemes: http, https
BasePath: /
Version: 1.0.0

Consumes:
- application/json

Produces:
- application/json

swagger:meta

Index

Constants

This section is empty.

Variables

View Source
var ServerStatus = Status{
	Online:  true,
	Started: time.Now(),
	Version: config.APP_VERSION,
	Size:    &db.Size,
	Events:  &events.Pool,
}

Functions

func Auth

func Auth(c *gin.Context)

swagger:route POST /auth authentication doAuth

Handler authenticating a user and returning a bearer token for API requests.

Consumes:

  • application/json

Produces:

  • application/json

Responses:

       200: authResponse
		  400: errorResponse
		  403: errorResponse
		  500: errorResponse

func ClearEvents

func ClearEvents(c *gin.Context)

func CreateRecord

func CreateRecord(c *gin.Context)

func CreateStore

func CreateStore(c *gin.Context)

func DeleteRecord

func DeleteRecord(c *gin.Context)

func DeleteStore

func DeleteStore(c *gin.Context)

func GetConfig

func GetConfig(c *gin.Context)

swagger:route GET /api/config configuration getConfig

Handler returning the current server configuration.

Produces:

  • application/json

Responses:

200: Configuration

func GetRecord

func GetRecord(c *gin.Context)

func GetRecordBuffer

func GetRecordBuffer(c *gin.Context)

func GetStatus

func GetStatus(c *gin.Context)

swagger:route GET /api/status status getStatus

Handler returning the current server status.

Produces:

  • application/json

Responses:

200: Status

func GetStore

func GetStore(c *gin.Context)

func ListRecords

func ListRecords(c *gin.Context)

func ListStores

func ListStores(c *gin.Context)

func SafeBind

func SafeBind(c *gin.Context, obj interface{}) error

func UpdateRecord

func UpdateRecord(c *gin.Context)

func UpdateStore

func UpdateStore(c *gin.Context)

Types

type AuthRequest

type AuthRequest struct {
	// API server username ( as per config.json ).
	// in: body
	// required: true
	Username string `json:"username"`
	// API server password ( as per config.json ).
	// in: body
	// required: true
	Password string `json:"password"`
}

Authentication credentials. swagger:model Auth

type AuthResponse

type AuthResponse struct {
	// The bearer token to use for API requests.
	// in: body
	Token string `json:"token"`
}

Authentication response. swagger:response authResponse

type Status

type Status struct {
	Online  bool            `json:"online"`
	Started time.Time       `json:"started"`
	Version string          `json:"version"`
	Size    *uint64         `json:"size"`
	Events  *[]events.Event `json:"events"`
}

Jump to

Keyboard shortcuts

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