server

package
v0.0.0-...-cdcdc8b Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(backend Backend) (http.Handler, error)

func SearchEndpoint

func SearchEndpoint(b Backend) http.Handler

Creates an instance of reference implementation http.Handler that uses the specified Backend

func ServiceProviderConfig

func ServiceProviderConfig(config *resource.ServiceProviderConfig) http.Handler

func UsersEndpoint

func UsersEndpoint(b Backend) http.Handler

Types

type Backend

type Backend interface {
	CreateUser(user *resource.User) (*resource.User, error)
	DeleteUser(id string) error
	ReplaceUser(id string, user *resource.User) error
	RetrieveUser(string) (*resource.User, error)
	Search(*resource.SearchRequest) (*resource.ListResponse, error)
}

type Builder

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

func (*Builder) Build

func (b *Builder) Build() (http.Handler, error)

func (*Builder) Handler

func (b *Builder) Handler(path string, hh http.Handler, options ...HandlerOption) *Builder

func (*Builder) SearchEndpoint

func (b *Builder) SearchEndpoint(handler http.Handler, options ...HandlerOption) *Builder

func (*Builder) UsersEndpoint

func (b *Builder) UsersEndpoint(handler http.Handler, options ...HandlerOption) *Builder

func (*Builder) WithBackend

func (b *Builder) WithBackend(backend Backend) *Builder

type Handler

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

type HandlerOption

type HandlerOption interface {
	Option
	// contains filtered or unexported methods
}

HandlerOption describes an option that can be passed to `(server.Builder).Handler()`.

func WithPath

func WithPath(v string) HandlerOption

WithPath specifies the path that the handler should be registered at

type Middleware

type Middleware interface {
	Wrap(http.Handler) http.Handler
}

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

func (MiddlewareFunc) Wrap

type Option

type Option = option.Interface

Jump to

Keyboard shortcuts

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