pollingprofile

package
v0.0.0-...-ed06964 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceName       = "PollingProfile"
	ResourceNamePlural = "PollingProfiles"
)

Variables

View Source
var DefaultPollingProfile = PollingProfile{
	ID:       id.ID("current"),
	Name:     "default",
	Default:  true,
	Strategy: Periodic,
	Periodic: &PeriodicPollingConfig{
		Timeout:              "1m",
		RetryDelay:           "5s",
		SelectorMatchRetries: 3,
	},
}

Functions

This section is empty.

Types

type PeriodicPollingConfig

type PeriodicPollingConfig struct {
	RetryDelay           string `json:"retryDelay"`
	Timeout              string `json:"timeout"`
	SelectorMatchRetries int    `json:"selectorMatchRetries"`
}

func (*PeriodicPollingConfig) MaxTracePollRetry

func (ppc *PeriodicPollingConfig) MaxTracePollRetry() int

func (*PeriodicPollingConfig) RetryDelayDuration

func (ppc *PeriodicPollingConfig) RetryDelayDuration() time.Duration

func (*PeriodicPollingConfig) TimeoutDuration

func (ppc *PeriodicPollingConfig) TimeoutDuration() time.Duration

func (*PeriodicPollingConfig) Validate

func (ppc *PeriodicPollingConfig) Validate() error

type PollingProfile

type PollingProfile struct {
	ID       id.ID                  `json:"id"`
	Name     string                 `json:"name"`
	Default  bool                   `json:"default"`
	Strategy Strategy               `json:"strategy"`
	Periodic *PeriodicPollingConfig `json:"periodic"`
}

func (PollingProfile) GetID

func (pp PollingProfile) GetID() id.ID

func (PollingProfile) HasID

func (pp PollingProfile) HasID() bool

func (PollingProfile) Validate

func (pp PollingProfile) Validate() error

type Repository

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

func NewRepository

func NewRepository(db *sql.DB) *Repository

func (*Repository) Count

func (r *Repository) Count(ctx context.Context, query string) (int, error)

func (*Repository) Create

func (r *Repository) Create(ctx context.Context, updated PollingProfile) (PollingProfile, error)

func (*Repository) Get

func (r *Repository) Get(ctx context.Context, id id.ID) (PollingProfile, error)

func (*Repository) GetDefault

func (r *Repository) GetDefault(ctx context.Context) PollingProfile

func (*Repository) List

func (r *Repository) List(ctx context.Context, take, skip int, query, sortBy, sortDirection string) ([]PollingProfile, error)

func (*Repository) Provision

func (r *Repository) Provision(ctx context.Context, profile PollingProfile) error

func (*Repository) SetID

func (r *Repository) SetID(profile PollingProfile, id id.ID) PollingProfile

func (*Repository) SortingFields

func (*Repository) SortingFields() []string

func (*Repository) Update

func (r *Repository) Update(ctx context.Context, updated PollingProfile) (PollingProfile, error)

type Strategy

type Strategy string
const (
	Periodic Strategy = "periodic"
)

Jump to

Keyboard shortcuts

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