sync

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	E_EVENT_TYPE_CREATE = iota
	E_EVENT_TYPE_MODIFY = 1
	E_EVENT_TYPE_DELETE = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type E_EVENT_TYPE

type E_EVENT_TYPE int32

type Event

type Event struct {
	EventType E_EVENT_TYPE
}

type FilePathSync

type FilePathSync struct {
	URI string
}

func (*FilePathSync) Fetch

func (fs *FilePathSync) Fetch() (string, error)

func (*FilePathSync) Notify

func (fs *FilePathSync) Notify(w chan<- INotify)

type HttpSync

type HttpSync struct {
	URI         string
	Client      *http.Client
	BearerToken string
	LastBodySHA string
}

func (*HttpSync) Fetch

func (fs *HttpSync) Fetch() (string, error)

func (*HttpSync) Notify

func (fs *HttpSync) Notify(w chan<- INotify)

type INotify

type INotify interface {
	GetEvent() Event
}

type ISync

type ISync interface {
	Fetch() (string, error)
	Notify(chan<- INotify)
}

ISync implementations watch for changes in the flag source (HTTP backend, local file, s3 bucket), and fetch the latest values.

type Notifier

type Notifier struct {
	Event Event
}

func (*Notifier) GetEvent

func (w *Notifier) GetEvent() Event

Jump to

Keyboard shortcuts

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