Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConstantRegistry ¶
type ConstantRegistry struct {
// contains filtered or unexported fields
}
ConstantRegistry is a registry that always returns the same JSON value it can be created from a JSON string or from a file path
func (*ConstantRegistry) GetJSON ¶
func (c *ConstantRegistry) GetJSON() ([]byte, error)
func (*ConstantRegistry) RegistryType ¶
func (c *ConstantRegistry) RegistryType() RegistryType
type ObserveRegistryResult ¶
type Registry ¶
type Registry interface { RegistryType() RegistryType GetJSON() ([]byte, error) }
Registry is the interface for the JSON registry It is used to get the JSON bytes representing a set of endpoints to redirects
func NewRegistry ¶
getRegistry will check if the given string is a) a JSON by itself b) if is a path to a file c) remote url
type RegistryType ¶
type RegistryType int
RegistryType is an enum-like type that represents the type of registry useful to conditionally observe the registry according to its type
const ( ConstantRegistryType RegistryType = iota RemoteRegistryType )
type RemoteRegistry ¶
type RemoteRegistry struct {
// contains filtered or unexported fields
}
RemoteRegistry represents a registry that is fetched from a remote URL it can be created from a valid URL returning the JSON value on http GET request
func (*RemoteRegistry) GetJSON ¶
func (r *RemoteRegistry) GetJSON() ([]byte, error)
func (*RemoteRegistry) RegistryType ¶
func (r *RemoteRegistry) RegistryType() RegistryType
Click to show internal directories.
Click to hide internal directories.