subscription

package
v0.0.0-...-8d511f4 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HEADER_TYPE = "crust-subscription"
)

Variables

This section is empty.

Functions

func Init

func Init(l *zap.Logger, ss settingsGetterSetter)

Init sets pkg basics: logger & settings interface

func UpdateCurrent

func UpdateCurrent(c *Claims)

Types

type Claims

type Claims struct {
	Domains  []string
	Trial    bool
	MaxUsers uint
	Expires  time.Time
}

func Load

func Load(ctx context.Context) *Claims

func (Claims) Valid

func (Claims) Valid() error

type SubscriptionChecker

type SubscriptionChecker interface {
	Validate(string, bool) error
	CanCreateUser(uint) error
	CanRegister(uint) error
}

Jump to

Keyboard shortcuts

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