hclconfig

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateInitialConfig added in v0.3.0

func GenerateInitialConfig(version string, sqsQueueName string, service string) ([]byte, error)

Types

type AlertBlock

type AlertBlock struct {
	MonitorID   *string
	MonitorName *string
	Any         *bool
	OnOpened    *bool
	OnClosed    *bool
}

func (*AlertBlock) DecodeBody added in v0.7.0

func (b *AlertBlock) DecodeBody(body hcl.Body, ctx *hcl.EvalContext) hcl.Diagnostics

type AuthBlock

type AuthBlock struct {
	ClientID     string `hcl:"client_id"`
	ClientSecret string `hcl:"client_secret"`
}

func (*AuthBlock) IsEmpty

func (b *AuthBlock) IsEmpty() bool

type Config

type Config struct {
	EvalContext *hcl.EvalContext
	Prepalert   PrepalertBlock
	Rules       RuleBlocks
	Queries     queryrunner.PreparedQueries
}

func Load

func Load(path string, version string, optFns ...func(loader *hclconfig.Loader)) (*Config, error)

func (*Config) DecodeBody added in v0.7.0

func (cfg *Config) DecodeBody(body hcl.Body, ctx *hcl.EvalContext) hcl.Diagnostics

func (*Config) ValidateVersion

func (cfg *Config) ValidateVersion(version string) error

type PrepalertBlock

type PrepalertBlock struct {
	SQSQueueName string
	Service      string
	Auth         *AuthBlock
	S3Backend    *S3BackendBlock
	// contains filtered or unexported fields
}

func (*PrepalertBlock) DecodeBody added in v0.7.0

func (b *PrepalertBlock) DecodeBody(body hcl.Body, ctx *hcl.EvalContext) hcl.Diagnostics

func (*PrepalertBlock) ValidateVersion

func (b *PrepalertBlock) ValidateVersion(version string) error

type RuleBlock

type RuleBlock struct {
	Name                              string
	Alert                             AlertBlock
	QueriesExpr                       hcl.Expression
	ParamsExpr                        hcl.Expression
	Information                       hcl.Expression
	UpdateAlertMemo                   bool
	PostGraphAnnotation               bool
	MaxGraphAnnotationDescriptionSize *int
	MaxAlertMemoSize                  *int

	Params  cty.Value
	Queries map[string]queryrunner.PreparedQuery
}

func (*RuleBlock) DecodeBody added in v0.7.0

func (b *RuleBlock) DecodeBody(body hcl.Body, ctx *hcl.EvalContext, queries queryrunner.PreparedQueries) hcl.Diagnostics

type RuleBlocks

type RuleBlocks []*RuleBlock

type S3BackendBlock added in v0.4.0

type S3BackendBlock struct {
	BucketName                    string
	ObjectKeyPrefix               *string
	ObjectKeyTemplate             *hcl.Expression
	ViewerBaseURLString           string
	ViewerGoogleClientID          *string
	ViewerGoogleClientSecret      *string
	ViewerSessionEncryptKeyString *string
	Allowed                       []string
	Denied                        []string

	ViewerBaseURL           *url.URL
	ViewerSessionEncryptKey []byte
	OnlyDetailURLOnMackerel bool
}

func (*S3BackendBlock) DecodeBody added in v0.7.0

func (b *S3BackendBlock) DecodeBody(body hcl.Body, ctx *hcl.EvalContext) hcl.Diagnostics

func (*S3BackendBlock) EnableGoogleAuth added in v0.4.0

func (b *S3BackendBlock) EnableGoogleAuth() bool

func (*S3BackendBlock) IsEmpty added in v0.4.0

func (b *S3BackendBlock) IsEmpty() bool

Jump to

Keyboard shortcuts

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