policydata

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0, BSD-3-Clause, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataConfig

type DataConfig struct {
	URL    string
	Method string
	Period Duration
	Body   interface{}
}

type Duration

type Duration time.Duration

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

type Refresher

type Refresher struct {
	// contains filtered or unexported fields
}

func NewRefresher

func NewRefresher(
	storage Storage,
	pollInterval time.Duration,
	httpClient *http.Client,
	logger *zap.Logger,
) *Refresher

func (*Refresher) Execute

func (e *Refresher) Execute(ctx context.Context, p *storage.Policy)

func (*Refresher) Start

func (e *Refresher) Start(ctx context.Context) error

type Storage

type Storage interface {
	GetRefreshPolicies(ctx context.Context) ([]*storage.Policy, error)
	UpdateNextRefreshTime(ctx context.Context, p *storage.Policy, nextDataRefreshTime time.Time) error
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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