conf

package
v0.2.15 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_examples_protos_custom_extension_any_example_proto protoreflect.FileDescriptor
View Source
var File_examples_protos_custom_extension_custom_config_proto protoreflect.FileDescriptor
View Source
var File_examples_protos_custom_extension_struct_example_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type ApplicationConfig

type ApplicationConfig struct {
	Enabled         bool             `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
	Name            string           `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	CustomizeConfig *structpb.Struct `protobuf:"bytes,3,opt,name=customize_config,proto3,oneof" json:"customize_config,omitempty"`
	// contains filtered or unexported fields
}

Application configuration

func (*ApplicationConfig) Descriptor deprecated

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

Deprecated: Use ApplicationConfig.ProtoReflect.Descriptor instead.

func (*ApplicationConfig) GetCustomizeConfig

func (x *ApplicationConfig) GetCustomizeConfig() *structpb.Struct

func (*ApplicationConfig) GetEnabled

func (x *ApplicationConfig) GetEnabled() bool

func (*ApplicationConfig) GetName

func (x *ApplicationConfig) GetName() string

func (*ApplicationConfig) ProtoMessage

func (*ApplicationConfig) ProtoMessage()

func (*ApplicationConfig) ProtoReflect

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

func (*ApplicationConfig) Reset

func (x *ApplicationConfig) Reset()

func (*ApplicationConfig) String

func (x *ApplicationConfig) String() string

func (*ApplicationConfig) Validate

func (m *ApplicationConfig) Validate() error

Validate checks the field values on ApplicationConfig 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 (*ApplicationConfig) ValidateAll

func (m *ApplicationConfig) ValidateAll() error

ValidateAll checks the field values on ApplicationConfig 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 ApplicationConfigMultiError, or nil if none found.

type ApplicationConfigMultiError

type ApplicationConfigMultiError []error

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

func (ApplicationConfigMultiError) AllErrors

func (m ApplicationConfigMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ApplicationConfigMultiError) Error

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

type ApplicationConfigValidationError

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

ApplicationConfigValidationError is the validation error returned by ApplicationConfig.Validate if the designated constraints aren't met.

func (ApplicationConfigValidationError) Cause

Cause function returns cause value.

func (ApplicationConfigValidationError) Error

Error satisfies the builtin error interface

func (ApplicationConfigValidationError) ErrorName

ErrorName returns error name.

func (ApplicationConfigValidationError) Field

Field function returns field value.

func (ApplicationConfigValidationError) Key

Key function returns key value.

func (ApplicationConfigValidationError) Reason

Reason function returns reason value.

type CustomAuthConfig

type CustomAuthConfig struct {

	// The policy definition, e.g., using Casbin model.
	Policy string `protobuf:"bytes,1,opt,name=policy,proto3" json:"policy,omitempty"`
	// The required scope for the endpoint.
	RequiredScope string `protobuf:"bytes,2,opt,name=required_scope,json=requiredScope,proto3" json:"required_scope,omitempty"`
	// contains filtered or unexported fields
}

CustomAuthConfig is the strongly-typed representation of our custom middleware config. We will convert the generic Struct into this specific type in our Go code.

func (*CustomAuthConfig) Descriptor deprecated

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

Deprecated: Use CustomAuthConfig.ProtoReflect.Descriptor instead.

func (*CustomAuthConfig) GetPolicy

func (x *CustomAuthConfig) GetPolicy() string

func (*CustomAuthConfig) GetRequiredScope

func (x *CustomAuthConfig) GetRequiredScope() string

func (*CustomAuthConfig) ProtoMessage

func (*CustomAuthConfig) ProtoMessage()

func (*CustomAuthConfig) ProtoReflect

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

func (*CustomAuthConfig) Reset

func (x *CustomAuthConfig) Reset()

func (*CustomAuthConfig) String

func (x *CustomAuthConfig) String() string

func (*CustomAuthConfig) Validate

func (m *CustomAuthConfig) Validate() error

Validate checks the field values on CustomAuthConfig 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 (*CustomAuthConfig) ValidateAll

func (m *CustomAuthConfig) ValidateAll() error

ValidateAll checks the field values on CustomAuthConfig 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 CustomAuthConfigMultiError, or nil if none found.

type CustomAuthConfigMultiError

type CustomAuthConfigMultiError []error

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

func (CustomAuthConfigMultiError) AllErrors

func (m CustomAuthConfigMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CustomAuthConfigMultiError) Error

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

type CustomAuthConfigValidationError

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

CustomAuthConfigValidationError is the validation error returned by CustomAuthConfig.Validate if the designated constraints aren't met.

func (CustomAuthConfigValidationError) Cause

Cause function returns cause value.

func (CustomAuthConfigValidationError) Error

Error satisfies the builtin error interface

func (CustomAuthConfigValidationError) ErrorName

ErrorName returns error name.

func (CustomAuthConfigValidationError) Field

Field function returns field value.

func (CustomAuthConfigValidationError) Key

Key function returns key value.

func (CustomAuthConfigValidationError) Reason

Reason function returns reason value.

type CustomConfig

type CustomConfig struct {
	CustomField  string                     `protobuf:"bytes,1,opt,name=custom_field,json=customField,proto3" json:"custom_field,omitempty"`
	CustomNumber int32                      `protobuf:"varint,2,opt,name=custom_number,json=customNumber,proto3" json:"custom_number,omitempty"`
	Items        []string                   `protobuf:"bytes,3,rep,name=items,proto3" json:"items,omitempty"`
	Nested       *CustomConfig_NestedConfig `protobuf:"bytes,4,opt,name=nested,proto3" json:"nested,omitempty"`
	// contains filtered or unexported fields
}

Custom configuration message

func (*CustomConfig) Descriptor deprecated

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

Deprecated: Use CustomConfig.ProtoReflect.Descriptor instead.

func (*CustomConfig) GetCustomField

func (x *CustomConfig) GetCustomField() string

func (*CustomConfig) GetCustomNumber

func (x *CustomConfig) GetCustomNumber() int32

func (*CustomConfig) GetItems

func (x *CustomConfig) GetItems() []string

func (*CustomConfig) GetNested

func (x *CustomConfig) GetNested() *CustomConfig_NestedConfig

func (*CustomConfig) ProtoMessage

func (*CustomConfig) ProtoMessage()

func (*CustomConfig) ProtoReflect

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

func (*CustomConfig) Reset

func (x *CustomConfig) Reset()

func (*CustomConfig) String

func (x *CustomConfig) String() string

func (*CustomConfig) Validate

func (m *CustomConfig) Validate() error

Validate checks the field values on CustomConfig 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 (*CustomConfig) ValidateAll

func (m *CustomConfig) ValidateAll() error

ValidateAll checks the field values on CustomConfig 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 CustomConfigMultiError, or nil if none found.

type CustomConfigMultiError

type CustomConfigMultiError []error

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

func (CustomConfigMultiError) AllErrors

func (m CustomConfigMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CustomConfigMultiError) Error

func (m CustomConfigMultiError) Error() string

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

type CustomConfigValidationError

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

CustomConfigValidationError is the validation error returned by CustomConfig.Validate if the designated constraints aren't met.

func (CustomConfigValidationError) Cause

Cause function returns cause value.

func (CustomConfigValidationError) Error

Error satisfies the builtin error interface

func (CustomConfigValidationError) ErrorName

func (e CustomConfigValidationError) ErrorName() string

ErrorName returns error name.

func (CustomConfigValidationError) Field

Field function returns field value.

func (CustomConfigValidationError) Key

Key function returns key value.

func (CustomConfigValidationError) Reason

Reason function returns reason value.

type CustomConfig_NestedConfig

type CustomConfig_NestedConfig struct {
	Enabled bool   `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
	Name    string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*CustomConfig_NestedConfig) Descriptor deprecated

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

Deprecated: Use CustomConfig_NestedConfig.ProtoReflect.Descriptor instead.

func (*CustomConfig_NestedConfig) GetEnabled

func (x *CustomConfig_NestedConfig) GetEnabled() bool

func (*CustomConfig_NestedConfig) GetName

func (x *CustomConfig_NestedConfig) GetName() string

func (*CustomConfig_NestedConfig) ProtoMessage

func (*CustomConfig_NestedConfig) ProtoMessage()

func (*CustomConfig_NestedConfig) ProtoReflect

func (*CustomConfig_NestedConfig) Reset

func (x *CustomConfig_NestedConfig) Reset()

func (*CustomConfig_NestedConfig) String

func (x *CustomConfig_NestedConfig) String() string

func (*CustomConfig_NestedConfig) Validate

func (m *CustomConfig_NestedConfig) Validate() error

Validate checks the field values on CustomConfig_NestedConfig 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 (*CustomConfig_NestedConfig) ValidateAll

func (m *CustomConfig_NestedConfig) ValidateAll() error

ValidateAll checks the field values on CustomConfig_NestedConfig 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 CustomConfig_NestedConfigMultiError, or nil if none found.

type CustomConfig_NestedConfigMultiError

type CustomConfig_NestedConfigMultiError []error

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

func (CustomConfig_NestedConfigMultiError) AllErrors

AllErrors returns a list of validation violation errors.

func (CustomConfig_NestedConfigMultiError) Error

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

type CustomConfig_NestedConfigValidationError

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

CustomConfig_NestedConfigValidationError is the validation error returned by CustomConfig_NestedConfig.Validate if the designated constraints aren't met.

func (CustomConfig_NestedConfigValidationError) Cause

Cause function returns cause value.

func (CustomConfig_NestedConfigValidationError) Error

Error satisfies the builtin error interface

func (CustomConfig_NestedConfigValidationError) ErrorName

ErrorName returns error name.

func (CustomConfig_NestedConfigValidationError) Field

Field function returns field value.

func (CustomConfig_NestedConfigValidationError) Key

Key function returns key value.

func (CustomConfig_NestedConfigValidationError) Reason

Reason function returns reason value.

type MiddlewareAny

type MiddlewareAny struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	// The 'customize' field expects a packed message with a type URL.
	// Loading a plain YAML/JSON object into this directly will fail.
	Customize *anypb.Any `protobuf:"bytes,100,opt,name=customize,proto3,oneof" json:"customize,omitempty"`
	// contains filtered or unexported fields
}

Middleware message using google.protobuf.Any. This approach is more complex when loading from a config file without a '@type' field.

func (*MiddlewareAny) Descriptor deprecated

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

Deprecated: Use MiddlewareAny.ProtoReflect.Descriptor instead.

func (*MiddlewareAny) GetCustomize

func (x *MiddlewareAny) GetCustomize() *anypb.Any

func (*MiddlewareAny) GetName

func (x *MiddlewareAny) GetName() string

func (*MiddlewareAny) GetType

func (x *MiddlewareAny) GetType() string

func (*MiddlewareAny) ProtoMessage

func (*MiddlewareAny) ProtoMessage()

func (*MiddlewareAny) ProtoReflect

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

func (*MiddlewareAny) Reset

func (x *MiddlewareAny) Reset()

func (*MiddlewareAny) String

func (x *MiddlewareAny) String() string

func (*MiddlewareAny) Validate

func (m *MiddlewareAny) Validate() error

Validate checks the field values on MiddlewareAny 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 (*MiddlewareAny) ValidateAll

func (m *MiddlewareAny) ValidateAll() error

ValidateAll checks the field values on MiddlewareAny 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 MiddlewareAnyMultiError, or nil if none found.

type MiddlewareAnyMultiError

type MiddlewareAnyMultiError []error

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

func (MiddlewareAnyMultiError) AllErrors

func (m MiddlewareAnyMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (MiddlewareAnyMultiError) Error

func (m MiddlewareAnyMultiError) Error() string

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

type MiddlewareAnyValidationError

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

MiddlewareAnyValidationError is the validation error returned by MiddlewareAny.Validate if the designated constraints aren't met.

func (MiddlewareAnyValidationError) Cause

Cause function returns cause value.

func (MiddlewareAnyValidationError) Error

Error satisfies the builtin error interface

func (MiddlewareAnyValidationError) ErrorName

func (e MiddlewareAnyValidationError) ErrorName() string

ErrorName returns error name.

func (MiddlewareAnyValidationError) Field

Field function returns field value.

func (MiddlewareAnyValidationError) Key

Key function returns key value.

func (MiddlewareAnyValidationError) Reason

Reason function returns reason value.

type MiddlewareStruct

type MiddlewareStruct struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	// The 'customize' field can hold any JSON-like structure from the config file,
	// which will be automatically parsed into a Struct.
	Customize *structpb.Struct `protobuf:"bytes,100,opt,name=customize,proto3,oneof" json:"customize,omitempty"`
	// contains filtered or unexported fields
}

Middleware message using google.protobuf.Struct for flexible custom configuration. This is the recommended approach.

func (*MiddlewareStruct) Descriptor deprecated

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

Deprecated: Use MiddlewareStruct.ProtoReflect.Descriptor instead.

func (*MiddlewareStruct) GetCustomize

func (x *MiddlewareStruct) GetCustomize() *structpb.Struct

func (*MiddlewareStruct) GetName

func (x *MiddlewareStruct) GetName() string

func (*MiddlewareStruct) GetType

func (x *MiddlewareStruct) GetType() string

func (*MiddlewareStruct) ProtoMessage

func (*MiddlewareStruct) ProtoMessage()

func (*MiddlewareStruct) ProtoReflect

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

func (*MiddlewareStruct) Reset

func (x *MiddlewareStruct) Reset()

func (*MiddlewareStruct) String

func (x *MiddlewareStruct) String() string

func (*MiddlewareStruct) Validate

func (m *MiddlewareStruct) Validate() error

Validate checks the field values on MiddlewareStruct 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 (*MiddlewareStruct) ValidateAll

func (m *MiddlewareStruct) ValidateAll() error

ValidateAll checks the field values on MiddlewareStruct 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 MiddlewareStructMultiError, or nil if none found.

type MiddlewareStructMultiError

type MiddlewareStructMultiError []error

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

func (MiddlewareStructMultiError) AllErrors

func (m MiddlewareStructMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (MiddlewareStructMultiError) Error

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

type MiddlewareStructValidationError

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

MiddlewareStructValidationError is the validation error returned by MiddlewareStruct.Validate if the designated constraints aren't met.

func (MiddlewareStructValidationError) Cause

Cause function returns cause value.

func (MiddlewareStructValidationError) Error

Error satisfies the builtin error interface

func (MiddlewareStructValidationError) ErrorName

ErrorName returns error name.

func (MiddlewareStructValidationError) Field

Field function returns field value.

func (MiddlewareStructValidationError) Key

Key function returns key value.

func (MiddlewareStructValidationError) Reason

Reason function returns reason value.

Jump to

Keyboard shortcuts

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