svc

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ocs

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

Ocs defines implements the business logic for Service.

func (Ocs) AddGroup added in v0.2.0

func (o Ocs) AddGroup(w http.ResponseWriter, r *http.Request)

AddGroup adds a group

func (Ocs) AddToGroup added in v0.2.0

func (o Ocs) AddToGroup(w http.ResponseWriter, r *http.Request)

AddToGroup adds a user to a group

func (Ocs) AddUser added in v0.2.0

func (o Ocs) AddUser(w http.ResponseWriter, r *http.Request)

AddUser creates a new user account

func (Ocs) DeleteGroup added in v0.2.0

func (o Ocs) DeleteGroup(w http.ResponseWriter, r *http.Request)

DeleteGroup deletes a group

func (Ocs) DeleteUser added in v0.2.0

func (o Ocs) DeleteUser(w http.ResponseWriter, r *http.Request)

DeleteUser deletes a user

func (Ocs) EditUser added in v0.2.0

func (o Ocs) EditUser(w http.ResponseWriter, r *http.Request)

EditUser creates a new user account

func (Ocs) GetConfig

func (o Ocs) GetConfig(w http.ResponseWriter, r *http.Request)

GetConfig renders the ocs config endpoint

func (Ocs) GetGroupMembers added in v0.2.0

func (o Ocs) GetGroupMembers(w http.ResponseWriter, r *http.Request)

GetGroupMembers lists all members of a group

func (Ocs) GetSigningKey

func (o Ocs) GetSigningKey(w http.ResponseWriter, r *http.Request)

GetSigningKey returns the signing key for the current user. It will create it on the fly if it does not exist The signing key is part of the user settings and is used by the proxy to authenticate requests Currently, the username is used as the OC-Credential

func (Ocs) GetUser

func (o Ocs) GetUser(w http.ResponseWriter, r *http.Request)

GetUser returns the currently logged in user

func (Ocs) ListGroups added in v0.2.0

func (o Ocs) ListGroups(w http.ResponseWriter, r *http.Request)

ListGroups lists all groups

func (Ocs) ListUserGroups added in v0.2.0

func (o Ocs) ListUserGroups(w http.ResponseWriter, r *http.Request)

ListUserGroups lists a users groups

func (Ocs) ListUsers

func (o Ocs) ListUsers(w http.ResponseWriter, r *http.Request)

ListUsers lists the users

func (Ocs) NotFound

func (o Ocs) NotFound(w http.ResponseWriter, r *http.Request)

NotFound uses ErrRender to always return a proper OCS payload

func (Ocs) RemoveFromGroup added in v0.2.0

func (o Ocs) RemoveFromGroup(w http.ResponseWriter, r *http.Request)

RemoveFromGroup removes a user from a group

func (Ocs) ServeHTTP

func (o Ocs) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the Service interface.

type Option

type Option func(o *Options)

Option defines a single option function.

func Config

func Config(val *config.Config) Option

Config provides a function to set the config option.

func Logger

func Logger(val log.Logger) Option

Logger provides a function to set the logger option.

func Middleware

func Middleware(val ...func(http.Handler) http.Handler) Option

Middleware provides a function to set the middleware option.

type Options

type Options struct {
	Logger     log.Logger
	Config     *config.Config
	Middleware []func(http.Handler) http.Handler
}

Options defines the available options for this package.

type Service

type Service interface {
	ServeHTTP(http.ResponseWriter, *http.Request)
	GetConfig(http.ResponseWriter, *http.Request)
}

Service defines the extension handlers.

func NewInstrument

func NewInstrument(next Service, metrics *metrics.Metrics) Service

NewInstrument returns a service that instruments metrics.

func NewLogging

func NewLogging(next Service, logger log.Logger) Service

NewLogging returns a service that logs messages.

func NewService

func NewService(opts ...Option) Service

NewService returns a service implementation for Service.

func NewTracing

func NewTracing(next Service) Service

NewTracing returns a service that instruments traces.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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