Documentation ¶
Index ¶
- Variables
- func ExistsTemplateFunc(ctx context.Context) interface{}
- func GetTemplateFunc(ctx context.Context) interface{}
- func ListTemplateFunc(ctx context.Context) interface{}
- func Register(protocol string, impl Implementation)
- func RegisterSanitizer(protocol string, impl UrlSanitizer)
- func Source(ctx context.Context, url string) ([]byte, error)
- type Change
- type Create
- type Delete
- type Implementation
- type Members
- type NotSupportedProtocol
- type Path
- type Registry
- type Timeout
- type Trigger
- type UrlSanitizer
- type Version
Constants ¶
This section is empty.
Variables ¶
View Source
var (
EmptyPath = path("")
)
Functions ¶
func ExistsTemplateFunc ¶
Template function that returns a True or False that a path exists
func GetTemplateFunc ¶
Template function that returns a string at the path/url
func ListTemplateFunc ¶
Template function that returns a list of members as string
func Register ¶
func Register(protocol string, impl Implementation)
func RegisterSanitizer ¶
func RegisterSanitizer(protocol string, impl UrlSanitizer)
Types ¶
type Implementation ¶
Registry backend implementations should follow this protocol to implement and register its services.
type Members ¶
type Members struct { Path `json:"path"` Min *int `json:"min,omitempty"` Max *int `json:"max,omitempty"` Delta *int `json:"delta,omitempty"` // delta of count OutsideRange bool `json:"outside_range,omitempty"` // default is within range. true for outside range. Trigger `json:"-"` }
For equality, set both min and max. For not equals, set min, max and OutsideRange to true.
func (*Members) SetOutsideRange ¶
type NotSupportedProtocol ¶
type NotSupportedProtocol struct {
Protocol string
}
func (*NotSupportedProtocol) Error ¶
func (this *NotSupportedProtocol) Error() string
type Path ¶
type Registry ¶
type Registry interface { io.Closer Id() url.URL Exists(Path) (bool, error) Get(Path) ([]byte, Version, error) Put(Path, []byte, bool) (Version, error) // Create or set. PutVersion(Path, []byte, Version) (Version, error) // Create or set with CAS - not for ephemeral nodes Delete(Path) error DeleteVersion(Path, Version) error // Delete with CAS List(Path) ([]Path, error) Trigger(Trigger) (<-chan interface{}, chan<- int, error) // events channel, channel to stop, error }
type Trigger ¶
type Trigger interface {
// contains filtered or unexported methods
}
The Trigger interface is designed so that it's not possible to implement this interface outside this package.
type Version ¶
type Version int32
const (
InvalidVersion Version = -1
)
Click to show internal directories.
Click to hide internal directories.