hr

package
v0.0.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtraHotReloadOptions

type ExtraHotReloadOptions func(*HotReload)

func WithBackendETCD

func WithBackendETCD(cfg backend.ConfigBackendETCD) ExtraHotReloadOptions

WithBackendETCD is an option which sets up the backend ETCD for hot reload.

func WithBackendLocalAPI

func WithBackendLocalAPI(cfg backend.ConfigBackendLocalAPI) ExtraHotReloadOptions

WithBackendLocalAPI is an option which sets up the backend local API for hot reload.

func WithCustomInterval

func WithCustomInterval(interval int) ExtraHotReloadOptions

WithCustomInterval is an option which sets up the custom interval for hot reload. if this option is not used the default interval is used.

func WithNoHotReload

func WithNoHotReload() ExtraHotReloadOptions

WithNoHotReload is an option which sets up the hot reload is disabled. if this option is not used the default hot reload is disabled.

type HotReload

type HotReload struct {
	Enabled     bool                     // hot reload is enabled
	Ticker      func() *time.Ticker      // ticker for hot reload
	Interval    int                      // interval for requesting value
	DoneLoop    chan bool                // done loop for hot reload
	HotReloader func() (Reloader, error) // hot Reloader
	Chan        chan data.DataHotReload  // chan for hot reload
}

func Setup

func Setup() (*HotReload, error)

Setup is a function which sets up the hot reload.

func (*HotReload) LoopHotReload

func (h *HotReload) LoopHotReload()

loopHotReload is a goroutine which is used to hot reload the zr.

type Reloader

type Reloader interface {
	Reload() data.DataHotReload
	Shutdown() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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