source

package
v2.0.0-...-c87de9c Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 6 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 codec.Coder) Option

WithEncoder sets the source encoder

type Options

type Options struct {
	Encoder codec.Coder     // Encoder
	Context context.Context // for alternative data
}

func NewOptions

func NewOptions(opts ...Option) Options

type Source

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

Source is the source from which config is loaded

type Watcher

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

Directories

Path Synopsis
Package file is a file source.
Package file is a file source.

Jump to

Keyboard shortcuts

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