Documentation
¶
Index ¶
- Variables
- func LoadFromYaml(data []byte)
- func WalkModules(f func(module *Module) error) error
- type AdminClient
- func (a *AdminClient) PutGlobalRules(id string, route *structpb.Struct) error
- func (a *AdminClient) PutRoute(id string, route *structpb.Struct) error
- func (a *AdminClient) PutStreamRoute(id string, route *structpb.Struct) error
- func (a *AdminClient) PutUpstream(id string, upstream *Upstream) error
- func (a *AdminClient) PutUpstreamStruct(id string, upstream *structpb.Struct) error
- type Config
- func (*Config) Descriptor() ([]byte, []int)deprecated
- func (x *Config) GetApiKey() string
- func (x *Config) GetEndpoint() string
- func (x *Config) GetModules() []*Module
- func (*Config) ProtoMessage()
- func (x *Config) ProtoReflect() protoreflect.Message
- func (x *Config) Reset()
- func (x *Config) String() string
- func (m *Config) Validate() error
- func (m *Config) ValidateAll() error
- type ConfigMultiError
- type ConfigValidationError
- type Module
- func (*Module) Descriptor() ([]byte, []int)deprecated
- func (x *Module) GetGlobalRules() map[string]*structpb.Struct
- func (x *Module) GetRoutes() map[string]*structpb.Struct
- func (x *Module) GetStreamRoutes() map[string]*structpb.Struct
- func (x *Module) GetUpstreams() map[string]*structpb.Struct
- func (*Module) ProtoMessage()
- func (x *Module) ProtoReflect() protoreflect.Message
- func (x *Module) Reset()
- func (x *Module) String() string
- func (m *Module) Validate() error
- func (m *Module) ValidateAll() error
- type ModuleMultiError
- type ModuleValidationError
- type Node
- func (*Node) Descriptor() ([]byte, []int)deprecated
- func (x *Node) GetHost() string
- func (x *Node) GetPort() uint64
- func (x *Node) GetWeight() int64
- func (*Node) ProtoMessage()
- func (x *Node) ProtoReflect() protoreflect.Message
- func (x *Node) Reset()
- func (x *Node) String() string
- func (m *Node) Validate() error
- func (m *Node) ValidateAll() error
- type NodeMultiError
- type NodeValidationError
- type Option
- type Upstream
- func (*Upstream) Descriptor() ([]byte, []int)deprecated
- func (x *Upstream) GetName() string
- func (x *Upstream) GetNodes() []*Node
- func (x *Upstream) GetScheme() string
- func (x *Upstream) GetType() string
- func (*Upstream) ProtoMessage()
- func (x *Upstream) ProtoReflect() protoreflect.Message
- func (x *Upstream) Reset()
- func (x *Upstream) String() string
- func (m *Upstream) Validate() error
- func (m *Upstream) ValidateAll() error
- type UpstreamMultiError
- type UpstreamValidationError
- type WatchSyncAdmin
Constants ¶
This section is empty.
Variables ¶
var (
ErrOption = errors.New("apisix endpoint and apiKey are required")
)
var File_apisix_apisix_proto protoreflect.FileDescriptor
Functions ¶
func LoadFromYaml ¶
func LoadFromYaml(data []byte)
func WalkModules ¶
Types ¶
type AdminClient ¶
type AdminClient struct {
// contains filtered or unexported fields
}
func NewAdminClient ¶
func NewAdminClient(endpoint string, apiKey string) (*AdminClient, error)
func (*AdminClient) PutGlobalRules ¶
func (a *AdminClient) PutGlobalRules(id string, route *structpb.Struct) error
PutGlobalRules https://apisix.apache.org/docs/apisix/admin-api/#global-rule-api
func (*AdminClient) PutRoute ¶
func (a *AdminClient) PutRoute(id string, route *structpb.Struct) error
PutRoute https://apisix.apache.org/docs/apisix/admin-api/#route-api
func (*AdminClient) PutStreamRoute ¶
func (a *AdminClient) PutStreamRoute(id string, route *structpb.Struct) error
PutStreamRoute https://apisix.apache.org/docs/apisix/admin-api/#stream-route-api
func (*AdminClient) PutUpstream ¶
func (a *AdminClient) PutUpstream(id string, upstream *Upstream) error
PutUpstream https://apisix.apache.org/docs/apisix/admin-api/#upstream-api
func (*AdminClient) PutUpstreamStruct ¶
func (a *AdminClient) PutUpstreamStruct(id string, upstream *structpb.Struct) error
PutUpstreamStruct https://apisix.apache.org/docs/apisix/admin-api/#upstream-api
type Config ¶
type Config struct { Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` ApiKey string `protobuf:"bytes,2,opt,name=api_key,json=apiKey,proto3" json:"api_key,omitempty"` Modules []*Module `protobuf:"bytes,3,rep,name=modules,proto3" json:"modules,omitempty"` // contains filtered or unexported fields }
func (*Config) Descriptor
deprecated
func (*Config) GetEndpoint ¶
func (*Config) GetModules ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶
func (x *Config) ProtoReflect() protoreflect.Message
func (*Config) Validate ¶
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 ¶
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 Module ¶
type Module struct { // https://apisix.apache.org/docs/apisix/admin-api/#route Routes map[string]*structpb.Struct `` /* 154-byte string literal not displayed */ // https://apisix.apache.org/docs/apisix/admin-api/#global-rule GlobalRules map[string]*structpb.Struct `` /* 183-byte string literal not displayed */ // https://apisix.apache.org/docs/apisix/admin-api/#upstream Upstreams map[string]*structpb.Struct `` /* 160-byte string literal not displayed */ // https://apisix.apache.org/docs/apisix/admin-api/#stream-route StreamRoutes map[string]*structpb.Struct `` /* 186-byte string literal not displayed */ // contains filtered or unexported fields }
func (*Module) Descriptor
deprecated
func (*Module) ProtoMessage ¶
func (*Module) ProtoMessage()
func (*Module) ProtoReflect ¶
func (x *Module) ProtoReflect() protoreflect.Message
func (*Module) Validate ¶
Validate checks the field values on Module 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 (*Module) ValidateAll ¶
ValidateAll checks the field values on Module 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 ModuleMultiError, or nil if none found.
type ModuleMultiError ¶
type ModuleMultiError []error
ModuleMultiError is an error wrapping multiple validation errors returned by Module.ValidateAll() if the designated constraints aren't met.
func (ModuleMultiError) AllErrors ¶
func (m ModuleMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ModuleMultiError) Error ¶
func (m ModuleMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ModuleValidationError ¶
type ModuleValidationError struct {
// contains filtered or unexported fields
}
ModuleValidationError is the validation error returned by Module.Validate if the designated constraints aren't met.
func (ModuleValidationError) Cause ¶
func (e ModuleValidationError) Cause() error
Cause function returns cause value.
func (ModuleValidationError) Error ¶
func (e ModuleValidationError) Error() string
Error satisfies the builtin error interface
func (ModuleValidationError) ErrorName ¶
func (e ModuleValidationError) ErrorName() string
ErrorName returns error name.
func (ModuleValidationError) Field ¶
func (e ModuleValidationError) Field() string
Field function returns field value.
func (ModuleValidationError) Key ¶
func (e ModuleValidationError) Key() bool
Key function returns key value.
func (ModuleValidationError) Reason ¶
func (e ModuleValidationError) Reason() string
Reason function returns reason value.
type Node ¶
type Node struct { Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` Port uint64 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` Weight int64 `protobuf:"varint,3,opt,name=weight,proto3" json:"weight,omitempty"` // contains filtered or unexported fields }
func (*Node) Descriptor
deprecated
func (*Node) ProtoMessage ¶
func (*Node) ProtoMessage()
func (*Node) ProtoReflect ¶
func (x *Node) ProtoReflect() protoreflect.Message
func (*Node) Validate ¶
Validate checks the field values on Node 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 (*Node) ValidateAll ¶
ValidateAll checks the field values on Node 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 NodeMultiError, or nil if none found.
type NodeMultiError ¶
type NodeMultiError []error
NodeMultiError is an error wrapping multiple validation errors returned by Node.ValidateAll() if the designated constraints aren't met.
func (NodeMultiError) AllErrors ¶
func (m NodeMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (NodeMultiError) Error ¶
func (m NodeMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type NodeValidationError ¶
type NodeValidationError struct {
// contains filtered or unexported fields
}
NodeValidationError is the validation error returned by Node.Validate if the designated constraints aren't met.
func (NodeValidationError) Cause ¶
func (e NodeValidationError) Cause() error
Cause function returns cause value.
func (NodeValidationError) Error ¶
func (e NodeValidationError) Error() string
Error satisfies the builtin error interface
func (NodeValidationError) ErrorName ¶
func (e NodeValidationError) ErrorName() string
ErrorName returns error name.
func (NodeValidationError) Field ¶
func (e NodeValidationError) Field() string
Field function returns field value.
func (NodeValidationError) Key ¶
func (e NodeValidationError) Key() bool
Key function returns key value.
func (NodeValidationError) Reason ¶
func (e NodeValidationError) Reason() string
Reason function returns reason value.
type Upstream ¶
type Upstream struct { Nodes []*Node `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` Scheme string `protobuf:"bytes,3,opt,name=scheme,proto3" json:"scheme,omitempty"` Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*Upstream) Descriptor
deprecated
func (*Upstream) ProtoMessage ¶
func (*Upstream) ProtoMessage()
func (*Upstream) ProtoReflect ¶
func (x *Upstream) ProtoReflect() protoreflect.Message
func (*Upstream) Validate ¶
Validate checks the field values on Upstream 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 (*Upstream) ValidateAll ¶
ValidateAll checks the field values on Upstream 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 UpstreamMultiError, or nil if none found.
type UpstreamMultiError ¶
type UpstreamMultiError []error
UpstreamMultiError is an error wrapping multiple validation errors returned by Upstream.ValidateAll() if the designated constraints aren't met.
func (UpstreamMultiError) AllErrors ¶
func (m UpstreamMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (UpstreamMultiError) Error ¶
func (m UpstreamMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type UpstreamValidationError ¶
type UpstreamValidationError struct {
// contains filtered or unexported fields
}
UpstreamValidationError is the validation error returned by Upstream.Validate if the designated constraints aren't met.
func (UpstreamValidationError) Cause ¶
func (e UpstreamValidationError) Cause() error
Cause function returns cause value.
func (UpstreamValidationError) Error ¶
func (e UpstreamValidationError) Error() string
Error satisfies the builtin error interface
func (UpstreamValidationError) ErrorName ¶
func (e UpstreamValidationError) ErrorName() string
ErrorName returns error name.
func (UpstreamValidationError) Field ¶
func (e UpstreamValidationError) Field() string
Field function returns field value.
func (UpstreamValidationError) Key ¶
func (e UpstreamValidationError) Key() bool
Key function returns key value.
func (UpstreamValidationError) Reason ¶
func (e UpstreamValidationError) Reason() string
Reason function returns reason value.
type WatchSyncAdmin ¶
type WatchSyncAdmin struct {
// contains filtered or unexported fields
}
func NewWatchSyncAdmin ¶
func NewWatchSyncAdmin(discovery registry.Discovery, adminClient *AdminClient, opt *Option) *WatchSyncAdmin