Documentation ¶
Index ¶
- type APIDiscoveryService
- type LocalMemoryAPIDiscoveryService
- func (l *LocalMemoryAPIDiscoveryService) AddAPI(api fr.API) error
- func (l *LocalMemoryAPIDiscoveryService) AddOrUpdateAPI(api fr.API) error
- func (l *LocalMemoryAPIDiscoveryService) ClearAPI() error
- func (l *LocalMemoryAPIDiscoveryService) GetAPI(url string, httpVerb config.HTTPVerb) (fr.API, error)
- func (l *LocalMemoryAPIDiscoveryService) InitAPIsFromConfig(apiConfig config.APIConfig) error
- func (l *LocalMemoryAPIDiscoveryService) MatchAPI(url string, httpVerb config.HTTPVerb) (fr.API, error)
- func (l *LocalMemoryAPIDiscoveryService) MethodAdd(res config.Resource, method config.Method) bool
- func (l *LocalMemoryAPIDiscoveryService) MethodChange(res config.Resource, new config.Method, old config.Method) bool
- func (l *LocalMemoryAPIDiscoveryService) MethodDelete(res config.Resource, method config.Method) bool
- func (l *LocalMemoryAPIDiscoveryService) RemoveAPI(fullPath string, method config.Method) error
- func (l *LocalMemoryAPIDiscoveryService) RemoveAPIByIntance(api fr.API) error
- func (l *LocalMemoryAPIDiscoveryService) RemoveAPIByPath(deleted config.Resource) error
- func (l *LocalMemoryAPIDiscoveryService) ResourceAdd(res config.Resource) bool
- func (l *LocalMemoryAPIDiscoveryService) ResourceChange(new config.Resource, old config.Resource) bool
- func (l *LocalMemoryAPIDiscoveryService) ResourceDelete(deleted config.Resource) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIDiscoveryService ¶
type APIDiscoveryService interface { pc.APIConfigResourceListener InitAPIsFromConfig(apiConfig config.APIConfig) error AddAPI(fr.API) error AddOrUpdateAPI(fr.API) error ClearAPI() error GetAPI(string, config.HTTPVerb) (fr.API, error) MatchAPI(string, config.HTTPVerb) (fr.API, error) RemoveAPIByPath(deleted config.Resource) error RemoveAPIByIntance(api fr.API) error RemoveAPI(fullPath string, method config.Method) error }
APIDiscoveryService api discovery service interface
type LocalMemoryAPIDiscoveryService ¶
type LocalMemoryAPIDiscoveryService struct {
// contains filtered or unexported fields
}
LocalMemoryAPIDiscoveryService is the local cached API discovery service
func NewLocalMemoryAPIDiscoveryService ¶
func NewLocalMemoryAPIDiscoveryService() *LocalMemoryAPIDiscoveryService
NewLocalMemoryAPIDiscoveryService creates a new LocalMemoryApiDiscoveryService instance
func (*LocalMemoryAPIDiscoveryService) AddAPI ¶
func (l *LocalMemoryAPIDiscoveryService) AddAPI(api fr.API) error
AddAPI adds a method to the router tree
func (*LocalMemoryAPIDiscoveryService) AddOrUpdateAPI ¶
func (l *LocalMemoryAPIDiscoveryService) AddOrUpdateAPI(api fr.API) error
AddOrUpdateAPI adds or updates a method to the router tree
func (*LocalMemoryAPIDiscoveryService) ClearAPI ¶
func (l *LocalMemoryAPIDiscoveryService) ClearAPI() error
ClearAPI clear all api
func (*LocalMemoryAPIDiscoveryService) GetAPI ¶
func (l *LocalMemoryAPIDiscoveryService) GetAPI(url string, httpVerb config.HTTPVerb) (fr.API, error)
GetAPI returns the method to the caller
func (*LocalMemoryAPIDiscoveryService) InitAPIsFromConfig ¶
func (l *LocalMemoryAPIDiscoveryService) InitAPIsFromConfig(apiConfig config.APIConfig) error
InitAPIsFromConfig inits the router from API config and to local cache
func (*LocalMemoryAPIDiscoveryService) MethodChange ¶
func (l *LocalMemoryAPIDiscoveryService) MethodChange(res config.Resource, new config.Method, old config.Method) bool
MethodChange handle modify method event
func (*LocalMemoryAPIDiscoveryService) MethodDelete ¶
func (l *LocalMemoryAPIDiscoveryService) MethodDelete(res config.Resource, method config.Method) bool
MethodDelete handle delete method event
func (*LocalMemoryAPIDiscoveryService) RemoveAPI ¶
func (l *LocalMemoryAPIDiscoveryService) RemoveAPI(fullPath string, method config.Method) error
RemoveAPIByPath remove all api
func (*LocalMemoryAPIDiscoveryService) RemoveAPIByIntance ¶
func (l *LocalMemoryAPIDiscoveryService) RemoveAPIByIntance(api fr.API) error
func (*LocalMemoryAPIDiscoveryService) RemoveAPIByPath ¶
func (l *LocalMemoryAPIDiscoveryService) RemoveAPIByPath(deleted config.Resource) error
RemoveAPIByPath remove all api belonged to path
func (*LocalMemoryAPIDiscoveryService) ResourceAdd ¶
func (l *LocalMemoryAPIDiscoveryService) ResourceAdd(res config.Resource) bool
ResourceAdd handle add resource event
func (*LocalMemoryAPIDiscoveryService) ResourceChange ¶
func (l *LocalMemoryAPIDiscoveryService) ResourceChange(new config.Resource, old config.Resource) bool
ResourceChange handle modify resource event
func (*LocalMemoryAPIDiscoveryService) ResourceDelete ¶
func (l *LocalMemoryAPIDiscoveryService) ResourceDelete(deleted config.Resource) bool
ResourceDelete handle delete resource event