web

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToUser

func ToUser(c context.Context) (*model.User, bool)

ToUser returns a user from the context.

func WithUser

func WithUser(c context.Context, user *model.User) context.Context

WithUser returns a context with the current authenticated user.

Types

type Endpoint

type Endpoint interface {
	// Register registers the provider endpoints.
	Register(*httptreemux.ContextMux)
}

Endpoint provides the website endpoints.

func New

func New(opt ...Option) Endpoint

New returns the default website endpoint.

type Option

type Option func(*Options)

Option configures the website handler.

func WithDir

func WithDir(s string) Option

WithDir configures the website hanlder with the directory value used to serve the website from the local filesystem.

func WithDocs

func WithDocs(s string) Option

WithDocs configures the website hanlder with the documentation website address, which should be included in the user interface.

func WithSync

func WithSync(d time.Duration) Option

WithSync configures the website hanlder with the duration value used to determine if the user account requires synchronization.

type Options

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

Options defines website handler options.

Jump to

Keyboard shortcuts

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