openapi

package
v0.0.0-...-a735c6b Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeJSONResponse

func EncodeJSONResponse(i interface{}, status *int, w http.ResponseWriter) error

EncodeJSONResponse uses the json encoder to write an interface to the http response with an optional status code

func Logger

func Logger(inner http.Handler, name string) http.Handler

func NewRouter

func NewRouter(routers ...Router) *mux.Router

NewRouter creates a new router for any number of api routers

func ReadFormFileToTempFile

func ReadFormFileToTempFile(r *http.Request, key string) (*os.File, error)

ReadFormFileToTempFile reads file data from a request form and writes it to a temporary file

Types

type Backup

type Backup struct {
	Identifier string `json:"identifier"`

	Bucket string `json:"bucket"`

	Location string `json:"location"`

	StartTime time.Time `json:"start_time"`

	EndTime *time.Time `json:"end_time,omitempty"`

	// backup status
	Status string `json:"status"`
}

Backup - output for a backup request

type BackupList

type BackupList struct {
	Size int32 `json:"size,omitempty"`

	Items []Backup `json:"items,omitempty"`
}

BackupList - The List of backups

type BackupRequest

type BackupRequest struct {
	Backend string `json:"backend"`

	Bucket string `json:"bucket"`

	Location string `json:"location"`

	Envs []EnvVar `json:"envs,omitempty"`
}

type Database

type Database struct {
	Name string `json:"name"`
}

type EnvVar

type EnvVar struct {
	Name string `json:"name"`

	Value string `json:"value"`
}

type Grant

type Grant struct {
	AccessMode string `json:"accessMode"`
}

type ListDatabases

type ListDatabases struct {
	Size int32 `json:"size,omitempty"`

	Items []Database `json:"items,omitempty"`
}

type ListUsers

type ListUsers struct {
	Size int32 `json:"size,omitempty"`

	Items []User `json:"items,omitempty"`
}

type Message

type Message struct {
	Code int32 `json:"code"`

	Message string `json:"message,omitempty"`
}

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

A Route defines the parameters for an api endpoint

type Router

type Router interface {
	Routes() Routes
}

Router defines the required methods for retrieving api routes

type Routes

type Routes []Route

Routes are a collection of defined api endpoints

type User

type User struct {
	Username string `json:"username"`

	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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