server

package
v0.0.0-...-47ace37 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2018 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authentication

func Authentication(authenticationType string) gin.HandlerFunc

Authentication is a gin middleware supporting multiple authentication schemes

func Get

Get setups endpoints as dictated by RFC 7644

Details at https://tools.ietf.org/html/rfc7644#section-3.2

func MethodNotImplemented

func MethodNotImplemented(notSupportedMethods []string) gin.HandlerFunc

MethodNotImplemented is a gin middleware responsible to abort requests which method is not supported.

func Scim2

func Scim2(group *gin.RouterGroup, resource Service)

Scim2 defines the routes as per RFC 7644

  POST 	/endpoint
  GET  	/endpoint
  POST 	/endpoint/.search
	 GET  	/endpoint/:id
  PUT  	/endpoint/:id
  PATCH  /endpoint/:id
  DELETE	/endpoint/:id

func Set

func Set(key string, val interface{}) gin.HandlerFunc

Set is a middleware to store a value by key within the context

func Status

func Status(code int) gin.HandlerFunc

Status is a gin middleware forcing the abortion of a request with the given code

func Storage

func Storage(adapter storage.Storer) gin.HandlerFunc

Storage is a middleware to

Types

type AuthenticationScheme

type AuthenticationScheme int

AuthenticationScheme ...

const (
	// OAuth identifies ...
	OAuth AuthenticationScheme = iota

	// OAuth2 identifies ...
	OAuth2

	// OAuthBearerToken identifies ...
	OAuthBearerToken

	// HTTPBasic identifies ...
	HTTPBasic

	// HTTPDigest identifies ...
	HTTPDigest
)

func (AuthenticationScheme) String

func (i AuthenticationScheme) String() string

type Deleter

type Deleter interface {
	Service
	Delete(*gin.Context)
}

Deleter ...

type Getter

type Getter interface {
	Service
	Get(*gin.Context)
}

Getter ...

type InternalServerError

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

InternalServerError is a generic server error

func (InternalServerError) Error

func (e InternalServerError) Error() string

type Lister

type Lister interface {
	Service
	List(*gin.Context)
}

Lister ...

type NotIdentifiableStaticResource

type NotIdentifiableStaticResource struct {
	Service
	Lister
	// contains filtered or unexported fields
}

NotIdentifiableStaticResource describers ...

func NewNotIdentifiableStaticResourceService

func NewNotIdentifiableStaticResourceService(endpoint string, resource interface{}) *NotIdentifiableStaticResource

NewNotIdentifiableStaticResourceService creates a new `NotIdentifiableStaticResource` given a path and a resource

func (*NotIdentifiableStaticResource) List

List ...

func (*NotIdentifiableStaticResource) Path

Path returns the endpoint of the `NotIdentifiableStaticResource`

type Patcher

type Patcher interface {
	Service
	Patch(*gin.Context)
}

Patcher ...

type Poster

type Poster interface {
	Service
	Post(*gin.Context)
}

Poster ...

type Putter

type Putter interface {
	Service
	Put(*gin.Context)
}

Putter ...

type ResourceService

type ResourceService struct {
	Service
	Lister
	Getter
	Putter
	Patcher
	Deleter
	Searcher
	// contains filtered or unexported fields
}

ResourceService describes ...

func NewResourceService

func NewResourceService(rt core.ResourceType) *ResourceService

NewResourceService creates a new `ResourceService` for the given `core.ResourceTyper`

func (*ResourceService) Delete

func (rs *ResourceService) Delete(c *gin.Context)

Delete ...

func (*ResourceService) Get

func (rs *ResourceService) Get(c *gin.Context)

Get ...

func (*ResourceService) List

func (rs *ResourceService) List(c *gin.Context)

List ...

func (*ResourceService) Patch

func (rs *ResourceService) Patch(c *gin.Context)

Patch ...

func (*ResourceService) Path

func (rs *ResourceService) Path() string

Path returns the endpoint of the `ResourceService`

func (*ResourceService) Post

func (rs *ResourceService) Post(c *gin.Context)

Post ...

func (*ResourceService) Put

func (rs *ResourceService) Put(c *gin.Context)

Put ...

func (*ResourceService) Search

func (rs *ResourceService) Search(c *gin.Context)

Search ...

type Searcher

type Searcher interface {
	Service
	Search(*gin.Context)
}

Searcher ...

type Service

type Service interface {
	Path() string
}

Service ...

type StaticResourceService

type StaticResourceService struct {
	Service
	Lister
	Getter
	// contains filtered or unexported fields
}

StaticResourceService describers ...

func NewStaticResourceService

func NewStaticResourceService(endpoint string, resources interface{}) *StaticResourceService

NewStaticResourceService creates a new `StaticResourceService` given a path and a list of `core.ResourceTyper`

func (*StaticResourceService) Get

func (rs *StaticResourceService) Get(c *gin.Context)

Get ...

func (*StaticResourceService) List

func (rs *StaticResourceService) List(c *gin.Context)

List ...

func (*StaticResourceService) Path

func (rs *StaticResourceService) Path() string

Path returns the endpoint of the `StaticResourceService`

Jump to

Keyboard shortcuts

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