entitlements

package
v2.15.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

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

func New

func New() *Set

func (*Set) AllowRefresh

func (l *Set) AllowRefresh(now time.Time) (bool, time.Duration)

AllowRefresh returns whether the entitlements are allowed to be refreshed. If it returns false, that means it was recently refreshed and the caller should wait the returned duration before trying again.

func (*Set) AsJSON

func (l *Set) AsJSON() json.RawMessage

AsJSON is used to return this to the api without exposing the entitlements for mutation.

func (*Set) Enabled

func (l *Set) Enabled(feature codersdk.FeatureName) bool

func (*Set) Feature

func (l *Set) Feature(name codersdk.FeatureName) (codersdk.Feature, bool)

func (*Set) FeatureChanged

func (l *Set) FeatureChanged(featureName codersdk.FeatureName, newFeature codersdk.Feature) (initial, changed, enabled bool)

func (*Set) Replace

func (l *Set) Replace(entitlements codersdk.Entitlements)

func (*Set) Update

func (l *Set) Update(do func(entitlements *codersdk.Entitlements))

func (*Set) WriteEntitlementWarningHeaders

func (l *Set) WriteEntitlementWarningHeaders(header http.Header)

Jump to

Keyboard shortcuts

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