api

package
v1.0.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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) MatchAPI

func (l *LocalMemoryAPIDiscoveryService) MatchAPI(url string, httpVerb config.HTTPVerb) (fr.API, error)

func (*LocalMemoryAPIDiscoveryService) MethodAdd

func (l *LocalMemoryAPIDiscoveryService) MethodAdd(res config.Resource, method config.Method) bool

MethodAdd handle add method event

func (*LocalMemoryAPIDiscoveryService) MethodChange

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

Jump to

Keyboard shortcuts

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