loader

package
v0.0.0-...-a046173 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdvancedRule

type AdvancedRule struct {
	Host   []string `json:"host"`
	Path   []string `json:"path"`
	Method []string `json:"method"`

	*meta.Permission
}

AdvancedRule allows you to write RBAC rules in a more concise way

type AdvancedRules

type AdvancedRules []*AdvancedRule

AdvancedRules is the list of AdvancedRules

func (AdvancedRules) GetRules

func (adv AdvancedRules) GetRules() meta.Rules

GetRules is used to convert AdvancedRules to meta.Rules

type AdvancedRulesLoader

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

AdvancedRulesLoader implements the Loader interface it is used to load configuration from advanced data.

func NewAdvancedRulesLoader

func NewAdvancedRulesLoader(rules AdvancedRules) (*AdvancedRulesLoader, error)

NewAdvancedRulesLoader is used to initialize a AdvancedRulesLoader

func (*AdvancedRulesLoader) Load

func (loader *AdvancedRulesLoader) Load() (meta.Rules, error)

Load is used to return a list of rules

type JSONLoader

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

JSONLoader implements the Loader interface it is used to load configuration from a local json file.

func NewJSONLoader

func NewJSONLoader(file string) (*JSONLoader, error)

NewJSONLoader is used to initialize a JSONLoader

func (*JSONLoader) Load

func (loader *JSONLoader) Load() (meta.Rules, error)

Load is used to return a list of rules

type RulesLoader

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

RulesLoader implements the Loader interface it is used to load configuration from given rules.

func NewRulesLoader

func NewRulesLoader(rules meta.Rules) (*RulesLoader, error)

NewRulesLoader is used to initialize a RulesLoader

func (*RulesLoader) Load

func (loader *RulesLoader) Load() (meta.Rules, error)

Load is used to return a list of rules

type YAMLLoader

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

YAMLLoader implements the Loader interface it is used to load configuration from a local yaml file.

func NewYAMLLoader

func NewYAMLLoader(file string) (*YAMLLoader, error)

NewYAMLLoader is used to initialize a YAMLLoader

func (*YAMLLoader) Load

func (loader *YAMLLoader) Load() (meta.Rules, error)

Load is used to return a list of rules

Jump to

Keyboard shortcuts

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