Documentation ¶
Index ¶
- Constants
- type Endpoint
- type Store
- func (s *Store) Contains(prefix string) bool
- func (s *Store) Get(endpointKey string) *TargetStore
- func (s *Store) GetEndpointURL(clusterID, prefix string) (string, bool)
- func (s *Store) GetEndpointURLs(prefix string, endpointKey string) []string
- func (s *Store) GetPassword(prefix string, endpointKey string) string
- func (s *Store) GetUsername(prefix string, endpointKey string) string
- func (s *Store) InitScope(prefix string)
- func (s *Store) Remove(prefix string)
- func (s *Store) RemoveDeleted(endpoints map[string]*models.Endpoint)
- func (s *Store) UpdateEndpoint(prefix string, endpoint *models.Endpoint) error
- func (s *Store) Write(endpointKey string, endpointStore *TargetStore)
- type TargetStore
- func (t *TargetStore) Count() int
- func (t *TargetStore) Get(id string) *models.Endpoint
- func (t *TargetStore) GetAll(scope string) (targets []*Endpoint)
- func (t *TargetStore) Next(scope string) (endpointData *Endpoint)
- func (t *TargetStore) Remove(endpointKey string)
- func (t *TargetStore) Write(id string, endpoint *models.Endpoint)
Constants ¶
const ( PublicURLScope = "public" PrivateURLScope = "private" )
Endpoint related constants.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Endpoint ¶
Endpoint represents an endpoint url with its credentials.
func NewEndpoint ¶
NewEndpoint returns new Endpoint.
type Store ¶
Store is used to store cluster specific endpoint targets store in-memory.
func (*Store) Get ¶
func (s *Store) Get(endpointKey string) *TargetStore
Get reads endpoint targets store from memory.
func (*Store) GetEndpointURL ¶
GetEndpointURL returns endpoint.
func (*Store) GetEndpointURLs ¶
GetEndpointURLs reads the urls of endpoint targets of the given store.
func (*Store) GetPassword ¶
GetPassword reads the password of the first endpoint target of the given store.
func (*Store) GetUsername ¶
GetUsername reads the username of the first endpoint target of the given store.
func (*Store) InitScope ¶
InitScope creates a new target store for a given prefix if it doesn't yet exist.
func (*Store) RemoveDeleted ¶
RemoveDeleted removes all endpoints that do not match the given ones.
func (*Store) UpdateEndpoint ¶
UpdateEndpoint writes endpoint target in memory if proxy endpoint not in store or updated.
func (*Store) Write ¶
func (s *Store) Write(endpointKey string, endpointStore *TargetStore)
Write writes endpoint targets store in-memory.
type TargetStore ¶
TargetStore is used to store service specific endpoint targets in-memory.
func (*TargetStore) Count ¶
func (t *TargetStore) Count() int
Count returns number of endpoint targets in memory.
func (*TargetStore) Get ¶
func (t *TargetStore) Get(id string) *models.Endpoint
Get endpoint target from memory.
func (*TargetStore) GetAll ¶
func (t *TargetStore) GetAll(scope string) (targets []*Endpoint)
GetAll reads all endpoint targets from target store using given scope. Order of returned targets is not deterministic.
func (*TargetStore) Next ¶
func (t *TargetStore) Next(scope string) (endpointData *Endpoint)
Next reads next endpoint target from memory in round robin fashion.
func (*TargetStore) Remove ¶
func (t *TargetStore) Remove(endpointKey string)
Remove removes endpoint target from memory.