license

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FreePlugins = []string{
		"webhookx-signature",
		"wasm",
		"function",
		"basic-auth",
		"key-auth",
		"hmac-auth",
		"event-validation",
	}

	EnterprisePlugins = []string{
		"connect-auth",
	}
)
View Source
var (
	ErrInvalidLicense = errors.New("license is invalid")
)

Functions

func Load

func Load() (*license.License, error)

Load loads license

func SetLicenser

func SetLicenser(licenser Licenser)

Types

type Condition

type Condition struct {
	Methods                 []string
	ExcludeDefaultWorkspace bool
}

type DefaultLicenser

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

func NewLicenser

func NewLicenser(license *license.License) *DefaultLicenser

func (*DefaultLicenser) Allow

func (l *DefaultLicenser) Allow(feature string) bool

func (*DefaultLicenser) AllowAPI

func (l *DefaultLicenser) AllowAPI(workspace string, path string, method string) bool

func (*DefaultLicenser) AllowPlugin

func (l *DefaultLicenser) AllowPlugin(plugin string) bool

func (*DefaultLicenser) License

func (l *DefaultLicenser) License() *license.License

type Licenser

type Licenser interface {
	Allow(feature string) bool
	AllowAPI(workspace string, path string, method string) bool
	AllowPlugin(plugin string) bool
	License() *license.License
}

func GetLicenser

func GetLicenser() Licenser

type Plan

type Plan struct {
	Name          string
	Features      []string
	Plugins       []string
	ForbiddenAPIs map[string]*Condition
	Limits        map[string]int
}

func (Plan) HasFeature

func (p Plan) HasFeature(feature string) bool

func (Plan) HasPlugin

func (p Plan) HasPlugin(name string) bool

Jump to

Keyboard shortcuts

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