casbin

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "casbin"
)

Variables

View Source
var (
	Config_Source_name = map[int32]string{
		0: "HEADER",
	}
	Config_Source_value = map[string]int32{
		"HEADER": 0,
	}
)

Enum value maps for Config_Source.

View Source
var File_plugins_casbin_config_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Config

type Config struct {
	Rule  *Config_Rule  `protobuf:"bytes,1,opt,name=rule,proto3" json:"rule,omitempty"`
	Token *Config_Token `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

func (*Config) Descriptor deprecated

func (*Config) Descriptor() ([]byte, []int)

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetRule

func (x *Config) GetRule() *Config_Rule

func (*Config) GetToken

func (x *Config) GetToken() *Config_Token

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect

func (x *Config) ProtoReflect() protoreflect.Message

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) String() string

func (*Config) Validate

func (m *Config) Validate() error

Validate checks the field values on Config with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Config) ValidateAll

func (m *Config) ValidateAll() error

ValidateAll checks the field values on Config with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ConfigMultiError, or nil if none found.

type ConfigMultiError

type ConfigMultiError []error

ConfigMultiError is an error wrapping multiple validation errors returned by Config.ValidateAll() if the designated constraints aren't met.

func (ConfigMultiError) AllErrors

func (m ConfigMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ConfigMultiError) Error

func (m ConfigMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ConfigValidationError

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

ConfigValidationError is the validation error returned by Config.Validate if the designated constraints aren't met.

func (ConfigValidationError) Cause

func (e ConfigValidationError) Cause() error

Cause function returns cause value.

func (ConfigValidationError) Error

func (e ConfigValidationError) Error() string

Error satisfies the builtin error interface

func (ConfigValidationError) ErrorName

func (e ConfigValidationError) ErrorName() string

ErrorName returns error name.

func (ConfigValidationError) Field

func (e ConfigValidationError) Field() string

Field function returns field value.

func (ConfigValidationError) Key

func (e ConfigValidationError) Key() bool

Key function returns key value.

func (ConfigValidationError) Reason

func (e ConfigValidationError) Reason() string

Reason function returns reason value.

type Config_Rule

type Config_Rule struct {
	Model  string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"`
	Policy string `protobuf:"bytes,2,opt,name=policy,proto3" json:"policy,omitempty"`
	// contains filtered or unexported fields
}

func (*Config_Rule) Descriptor deprecated

func (*Config_Rule) Descriptor() ([]byte, []int)

Deprecated: Use Config_Rule.ProtoReflect.Descriptor instead.

func (*Config_Rule) GetModel

func (x *Config_Rule) GetModel() string

func (*Config_Rule) GetPolicy

func (x *Config_Rule) GetPolicy() string

func (*Config_Rule) ProtoMessage

func (*Config_Rule) ProtoMessage()

func (*Config_Rule) ProtoReflect

func (x *Config_Rule) ProtoReflect() protoreflect.Message

func (*Config_Rule) Reset

func (x *Config_Rule) Reset()

func (*Config_Rule) String

func (x *Config_Rule) String() string

func (*Config_Rule) Validate

func (m *Config_Rule) Validate() error

Validate checks the field values on Config_Rule with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Config_Rule) ValidateAll

func (m *Config_Rule) ValidateAll() error

ValidateAll checks the field values on Config_Rule with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in Config_RuleMultiError, or nil if none found.

type Config_RuleMultiError

type Config_RuleMultiError []error

Config_RuleMultiError is an error wrapping multiple validation errors returned by Config_Rule.ValidateAll() if the designated constraints aren't met.

func (Config_RuleMultiError) AllErrors

func (m Config_RuleMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (Config_RuleMultiError) Error

func (m Config_RuleMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type Config_RuleValidationError

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

Config_RuleValidationError is the validation error returned by Config_Rule.Validate if the designated constraints aren't met.

func (Config_RuleValidationError) Cause

Cause function returns cause value.

func (Config_RuleValidationError) Error

Error satisfies the builtin error interface

func (Config_RuleValidationError) ErrorName

func (e Config_RuleValidationError) ErrorName() string

ErrorName returns error name.

func (Config_RuleValidationError) Field

Field function returns field value.

func (Config_RuleValidationError) Key

Key function returns key value.

func (Config_RuleValidationError) Reason

Reason function returns reason value.

type Config_Source

type Config_Source int32
const (
	Config_HEADER Config_Source = 0
)

func (Config_Source) Descriptor

func (Config_Source) Enum

func (x Config_Source) Enum() *Config_Source

func (Config_Source) EnumDescriptor deprecated

func (Config_Source) EnumDescriptor() ([]byte, []int)

Deprecated: Use Config_Source.Descriptor instead.

func (Config_Source) Number

func (Config_Source) String

func (x Config_Source) String() string

func (Config_Source) Type

type Config_Token

type Config_Token struct {
	Source Config_Source `protobuf:"varint,1,opt,name=source,proto3,enum=plugins.casbin.Config_Source" json:"source,omitempty"`
	Name   string        `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*Config_Token) Descriptor deprecated

func (*Config_Token) Descriptor() ([]byte, []int)

Deprecated: Use Config_Token.ProtoReflect.Descriptor instead.

func (*Config_Token) GetName

func (x *Config_Token) GetName() string

func (*Config_Token) GetSource

func (x *Config_Token) GetSource() Config_Source

func (*Config_Token) ProtoMessage

func (*Config_Token) ProtoMessage()

func (*Config_Token) ProtoReflect

func (x *Config_Token) ProtoReflect() protoreflect.Message

func (*Config_Token) Reset

func (x *Config_Token) Reset()

func (*Config_Token) String

func (x *Config_Token) String() string

func (*Config_Token) Validate

func (m *Config_Token) Validate() error

Validate checks the field values on Config_Token with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Config_Token) ValidateAll

func (m *Config_Token) ValidateAll() error

ValidateAll checks the field values on Config_Token with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in Config_TokenMultiError, or nil if none found.

type Config_TokenMultiError

type Config_TokenMultiError []error

Config_TokenMultiError is an error wrapping multiple validation errors returned by Config_Token.ValidateAll() if the designated constraints aren't met.

func (Config_TokenMultiError) AllErrors

func (m Config_TokenMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (Config_TokenMultiError) Error

func (m Config_TokenMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type Config_TokenValidationError

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

Config_TokenValidationError is the validation error returned by Config_Token.Validate if the designated constraints aren't met.

func (Config_TokenValidationError) Cause

Cause function returns cause value.

func (Config_TokenValidationError) Error

Error satisfies the builtin error interface

func (Config_TokenValidationError) ErrorName

func (e Config_TokenValidationError) ErrorName() string

ErrorName returns error name.

func (Config_TokenValidationError) Field

Field function returns field value.

func (Config_TokenValidationError) Key

Key function returns key value.

func (Config_TokenValidationError) Reason

Reason function returns reason value.

Jump to

Keyboard shortcuts

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