source

package
v0.0.0-...-3197215 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package source is the interface for sources

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeSet

type ChangeSet struct {
	Data      []byte
	Checksum  string
	Format    string
	Source    string
	Timestamp time.Time
}

ChangeSet represents a set of changes from a source

func (*ChangeSet) Sum

func (c *ChangeSet) Sum() string

Sum returns the md5 checksum of the ChangeSet data

type Option

type Option func(o *Options)

func WithEncoder

func WithEncoder(e encoder.Encoder) Option

WithEncoder sets the source encoder

type Options

type Options struct {
	// Encoder
	Encoder encoder.Encoder

	// for alternative data
	Context context.Context
}

func NewOptions

func NewOptions(opts ...Option) Options

type Source

type Source interface {
	Read() (*ChangeSet, error)
	Watch() (Watcher, error)
	String() string
}

Source is the source from which config is loaded

type Watcher

type Watcher interface {
	Next() (*ChangeSet, error)
	Stop() error
}

Watcher watches a source for changes

func NewNoopWatcher

func NewNoopWatcher() (Watcher, error)

NewNoopWatcher returns a watcher that blocks on Next() until Stop() is called.

Directories

Path Synopsis
Package configmap config is an interface for dynamic configuration.
Package configmap config is an interface for dynamic configuration.
Package file is a file source.
Package file is a file source.
proto
Package grpc is a generated protocol buffer package.
Package grpc is a generated protocol buffer package.
Package memory is a memory source
Package memory is a memory source
package runtimevar is the source for github.com/google/go-cloud/runtimevar
package runtimevar is the source for github.com/google/go-cloud/runtimevar
Package url loads changesets from a url
Package url loads changesets from a url

Jump to

Keyboard shortcuts

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