Documentation ¶
Overview ¶
Package hash provides a simple API for managing service hashes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ServiceHashHolderUninitialized = errors.New("ServiceHashHolder is not initialized")
)
Functions ¶
This section is empty.
Types ¶
type ServiceHash ¶
type ServiceHash interface { // Get returns the service URL associated with the given key. Get([]byte) (string, error) }
ServiceHash represents a component which can return URLs as strings based on arbitrary keys.
type ServiceHashHolder ¶
type ServiceHashHolder struct {
// contains filtered or unexported fields
}
ServiceHashHolder represents an atomic pointer to a ServiceHash. This pointer can be used without locking. This type implements ServiceHash. The current reference is used via the ServiceHash interface.
func (*ServiceHashHolder) Connected ¶
func (holder *ServiceHashHolder) Connected() bool
Connected checks whether this holder has any hash entries. This implementations handler.Connection, which allows this holder to participate in request gating.
func (*ServiceHashHolder) Update ¶
func (holder *ServiceHashHolder) Update(newHash ServiceHash)
Update atomically updates the current ServiceHash instance. Subsequent calls to Get() will use the newHash instance.
Click to show internal directories.
Click to hide internal directories.