web

package
v0.8.11 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: Apache-2.0 Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 handler with the directory value used to serve the website from the local filesystem.

func WithDocs

func WithDocs(s string) Option

WithDocs configures the website handler 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 handler 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