Documentation ¶
Index ¶
- func DeleteRoute(route *v1.Route) error
- func DeleteSsl(ssl *v1.Ssl) error
- func DeleteUpstream(upstream *v1.Upstream) error
- func FindCurrentRoute(route *v1.Route) (*v1.Route, error)
- func FindCurrentService(group, name, fullName string) (*v1.Service, error)
- func FindCurrentUpstream(group, name, fullName string) (*v1.Upstream, error)
- func Get(url string) ([]byte, error)
- func ListRoute(group string) ([]*v1.Route, error)
- func ListService(group string) ([]*v1.Service, error)
- func ListSsl(group string) ([]*v1.Ssl, error)
- func ListUpstream(group string) ([]*v1.Upstream, error)
- func PatchNodes(upstream *v1.Upstream, nodes []*v1.Node) error
- func UpdateRoute(route *v1.Route) error
- func UpdateUpstream(upstream *v1.Upstream) error
- type Cors
- type ErrorResponse
- type Event
- type IpRestriction
- type Match
- type Redirect
- type Route
- type RouteRequest
- type RouteResponse
- type RouteSet
- type Routes
- type RoutesResponse
- type Routex
- type Rule
- type Service
- type ServiceRequest
- type ServiceResponse
- type ServiceSet
- type ServiceValue
- type Services
- type ServicesResponse
- type SslList
- type SslNode
- type SslResponse
- type SslSet
- type SslsResponse
- type Token
- type Upstream
- type UpstreamNodes
- type UpstreamRequest
- type UpstreamResponse
- type UpstreamSet
- type Upstreams
- type UpstreamsResponse
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteRoute ¶
func DeleteUpstream ¶
func FindCurrentRoute ¶
FindCurrentRoute find current route in memDB
func FindCurrentService ¶
FindCurrentService find service from memDB, if Not Found, find service from apisix
func FindCurrentUpstream ¶
FindCurrentUpstream find upstream from memDB, if Not Found, find upstream from apisix
func ListService ¶
ListUpstream list upstream from etcd , convert to v1.Upstream
func ListUpstream ¶
ListUpstream list upstream from etcd , convert to v1.Upstream
func UpdateRoute ¶
func UpdateUpstream ¶
Types ¶
type Cors ¶
type Cors struct { Origins []string `json:"origins,omitempty"` Headers []string `json:"headers,omitempty"` Methods []string `json:"methods,omitempty"` MaxAge int64 `json:"max_age,omitempty"` }
Cors
type ErrorResponse ¶
type IpRestriction ¶
type IpRestriction struct { Whitelist []string `json:"whitelist,omitempty"` Blacklist []string `json:"blacklist,omitempty"` }
ip-restrictio
func BuildIpRestriction ¶
func BuildIpRestriction(whites, blacks *string) *IpRestriction
Convert2IpRestriction build IpRestriction
type RouteRequest ¶
type RouteResponse ¶
type RouteSet ¶ added in v0.2.2
type RouteSet []Route
func (*RouteSet) UnmarshalJSON ¶ added in v0.2.2
RouteSet.UnmarshalJSON implements json.Unmarshaler interface. lua-cjson doesn't distinguish empty array and table, and by default empty array will be encoded as '{}'. We have to maintain the compatibility.
type RoutesResponse ¶
type RoutesResponse struct {
Routes Routes `json:"node"`
}
type Service ¶
type Service struct { Key *string `json:"key"` // service key ServiceValue ServiceValue `json:"value,omitempty"` }
type ServiceRequest ¶
type ServiceResponse ¶
func AddService ¶
func AddService(service *v1.Service) (*ServiceResponse, error)
func UpdateService ¶
func UpdateService(service *v1.Service) (*ServiceResponse, error)
type ServiceSet ¶ added in v0.2.2
type ServiceSet []Service
func (*ServiceSet) UnmarshalJSON ¶ added in v0.2.2
func (set *ServiceSet) UnmarshalJSON(p []byte) error
UpstreamSet.UnmarshalJSON implements json.Unmarshaler interface. lua-cjson doesn't distinguish empty array and table, and by default empty array will be encoded as '{}'. We have to maintain the compatibility.
type ServiceValue ¶
type Services ¶
type Services struct { Key string `json:"key"` // 用来定位upstreams 列表 Services ServiceSet `json:"nodes"` }
type ServicesResponse ¶
type ServicesResponse struct {
Services Services `json:"node"`
}
type SslResponse ¶
func AddOrUpdateSsl ¶
func AddOrUpdateSsl(ssl *v1.Ssl) (*SslResponse, error)
type SslSet ¶ added in v0.2.4
type SslSet []SslNode
func (*SslSet) UnmarshalJSON ¶ added in v0.2.4
SslSet.UnmarshalJSON implements json.Unmarshaler interface. lua-cjson doesn't distinguish empty array and table, and by default empty array will be encoded as '{}'. We have to maintain the compatibility.
type SslsResponse ¶
type Upstream ¶
type Upstream struct { Key *string `json:"key"` // upstream key UpstreamNodes UpstreamNodes `json:"value"` }
type UpstreamNodes ¶
type UpstreamRequest ¶
type UpstreamRequest struct { LBType string `json:"type"` HashOn *string `json:"hash_on,omitempty"` Key *string `json:"key,omitempty"` Nodes map[string]int64 `json:"nodes"` Desc string `json:"desc"` }
{"type":"roundrobin","nodes":{"10.244.10.11:8080":100},"desc":"somesvc"}
type UpstreamResponse ¶
func AddUpstream ¶
func AddUpstream(upstream *v1.Upstream) (*UpstreamResponse, error)
type UpstreamSet ¶ added in v0.2.1
type UpstreamSet []Upstream
func (*UpstreamSet) UnmarshalJSON ¶ added in v0.2.1
func (set *UpstreamSet) UnmarshalJSON(p []byte) error
UpstreamSet.UnmarshalJSON implements json.Unmarshaler interface. lua-cjson doesn't distinguish empty array and table, and by default empty array will be encoded as '{}'. We have to maintain the compatibility.
type Upstreams ¶
type Upstreams struct { Key string `json:"key"` // 用来定位upstreams 列表 Upstreams UpstreamSet `json:"nodes"` }
type UpstreamsResponse ¶
type UpstreamsResponse struct {
Upstreams Upstreams `json:"node"`
}