frontend

package
v0.0.0-...-9518a5e Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2021 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Providers is what we offer to dependency injection.
	Providers = wire.NewSet(
		ProvideService,
		ProvideAuthService,
		ProvideUsersService,
	)
)

Functions

This section is empty.

Types

type AuthService

type AuthService interface {
	UserAttributionMiddleware(next http.Handler) http.Handler
	PermissionFilterMiddleware(permissions ...authorization.Permission) func(next http.Handler) http.Handler
	ServiceAdminMiddleware(next http.Handler) http.Handler

	AuthenticateUser(ctx context.Context, loginData *types.UserLoginInput) (*types.User, *http.Cookie, error)
	LogoutUser(ctx context.Context, sessionCtxData *types.SessionContextData, req *http.Request, res http.ResponseWriter) error
}

AuthService is a subset of the larger types.AuthService interface.

func ProvideAuthService

func ProvideAuthService(x types.AuthService) AuthService

ProvideAuthService does what I hope one day wire figures out how to do.

type Config

type Config struct {
	UseFakeData bool `json:"use_fake_data" mapstructure:"use_fake_data" toml:"use_fake_data"`
	// contains filtered or unexported fields
}

Config configures the frontend service.

func (*Config) ValidateWithContext

func (cfg *Config) ValidateWithContext(ctx context.Context) error

ValidateWithContext validates a Config struct.

type Service

type Service interface {
	SetupRoutes(router routing.Router)
}

Service serves HTML.

func ProvideService

func ProvideService(
	cfg *Config,
	logger logging.Logger,
	authService AuthService,
	usersService UsersService,
	dataStore database.DataManager,
	routeParamManager routing.RouteParamManager,
) Service

ProvideService builds a new Service.

type UsersService

type UsersService interface {
	RegisterUser(ctx context.Context, registrationInput *types.UserRegistrationInput) (*types.UserCreationResponse, error)
	VerifyUserTwoFactorSecret(ctx context.Context, input *types.TOTPSecretVerificationInput) error
}

UsersService is a subset of the larger types.UsersService interface.

func ProvideUsersService

func ProvideUsersService(x types.UserDataService) UsersService

ProvideUsersService does what I hope one day wire figures out how to do.

Jump to

Keyboard shortcuts

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