Documentation ¶
Index ¶
- Constants
- Variables
- type PeriodicPollingConfig
- type PollingProfile
- type Repository
- func (r *Repository) Count(ctx context.Context, query string) (int, error)
- func (r *Repository) Create(ctx context.Context, updated PollingProfile) (PollingProfile, error)
- func (r *Repository) Get(ctx context.Context, id id.ID) (PollingProfile, error)
- func (r *Repository) GetDefault(ctx context.Context) PollingProfile
- func (r *Repository) List(ctx context.Context, take, skip int, query, sortBy, sortDirection string) ([]PollingProfile, error)
- func (r *Repository) Provision(ctx context.Context, profile PollingProfile) error
- func (r *Repository) SetID(profile PollingProfile, id id.ID) PollingProfile
- func (*Repository) SortingFields() []string
- func (r *Repository) Update(ctx context.Context, updated PollingProfile) (PollingProfile, error)
- type Strategy
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, }, }
View Source
var Operations = []resourcemanager.Operation{ resourcemanager.OperationGet, resourcemanager.OperationList, resourcemanager.OperationUpdate, }
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) 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)
Click to show internal directories.
Click to hide internal directories.