rest

package
v0.0.0-...-f4df827 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OP_ADD     = "add"
	OP_REMOVE  = "remove"
	OP_REPLACE = "replace"
)

Variables

This section is empty.

Functions

func AcceptJSON

func AcceptJSON() gin.HandlerFunc

Recovery returns a middleware that recovers from any panics and writes a 500 if there was one.

func ApplyPatch

func ApplyPatch(changes []PatchChange, fields []PatchFieldInfo, fallback *map[string]string) (bool, error)

func DecodePatchPath

func DecodePatchPath(path string) ([]string, error)

func RequiresFormat

func RequiresFormat(ctype string) gin.HandlerFunc

func StringListAdd

func StringListAdd(vals []string, val string) []string

func StringListDel

func StringListDel(vals []string, val string) []string

Types

type LinkInfo

type LinkInfo struct {
	Rel  string `json:"rel"`
	HRef string `json:"href"`
	Type string `json:"type,omitempty"`
}

type PatchChange

type PatchChange struct {
	Op    string
	Path  string
	Value interface{}
}

type PatchFieldInfo

type PatchFieldInfo struct {
	Name       []string
	String     *string
	StringPtr  **string
	Boolean    *bool
	UInt64     *uint64
	UInt64Ptr  **uint64
	StringList *[]string
}

func GetPatchField

func GetPatchField(name []string, fields []PatchFieldInfo) (PatchFieldInfo, error)

type Service

type Service interface {
	RegisterRoutes(router *gin.RouterGroup)
	GetPrefix() string
	GetName() string
	GetType() string
	GetUID() string
}

type ServiceList

type ServiceList struct {
	Services []Service
}

func (*ServiceList) AddService

func (svcs *ServiceList) AddService(svc Service)

func (*ServiceList) RegisterRoutes

func (svcs *ServiceList) RegisterRoutes(router *gin.Engine)

Directories

Path Synopsis
compute
identity
v3
image
v2

Jump to

Keyboard shortcuts

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