alertspb

package
v0.0.0-...-2ecc15d Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: AGPL-3.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthAlerts = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowAlerts   = fmt.Errorf("proto: integer overflow")
)
View Source
var (
	ErrNotFound = errors.New("alertmanager storage object not found")
)

Functions

func ParseTemplates

func ParseTemplates(cfg AlertConfigDesc) map[string]string

ParseTemplates returns an Alertmanager config object.

Types

type AlertConfigDesc

type AlertConfigDesc struct {
	User      string          `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	RawConfig string          `protobuf:"bytes,2,opt,name=raw_config,json=rawConfig,proto3" json:"raw_config,omitempty"`
	Templates []*TemplateDesc `protobuf:"bytes,3,rep,name=templates,proto3" json:"templates,omitempty"`
}

func ToProto

func ToProto(cfg string, templates map[string]string, user string) AlertConfigDesc

ToProto transforms a yaml Alertmanager config and map of template files to an AlertConfigDesc.

func (*AlertConfigDesc) Descriptor

func (*AlertConfigDesc) Descriptor() ([]byte, []int)

func (*AlertConfigDesc) Equal

func (this *AlertConfigDesc) Equal(that interface{}) bool

func (*AlertConfigDesc) GetRawConfig

func (m *AlertConfigDesc) GetRawConfig() string

func (*AlertConfigDesc) GetTemplates

func (m *AlertConfigDesc) GetTemplates() []*TemplateDesc

func (*AlertConfigDesc) GetUser

func (m *AlertConfigDesc) GetUser() string

func (*AlertConfigDesc) GoString

func (this *AlertConfigDesc) GoString() string

func (*AlertConfigDesc) Marshal

func (m *AlertConfigDesc) Marshal() (dAtA []byte, err error)

func (*AlertConfigDesc) MarshalTo

func (m *AlertConfigDesc) MarshalTo(dAtA []byte) (int, error)

func (*AlertConfigDesc) MarshalToSizedBuffer

func (m *AlertConfigDesc) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AlertConfigDesc) ProtoMessage

func (*AlertConfigDesc) ProtoMessage()

func (*AlertConfigDesc) Reset

func (m *AlertConfigDesc) Reset()

func (*AlertConfigDesc) Size

func (m *AlertConfigDesc) Size() (n int)

func (*AlertConfigDesc) String

func (this *AlertConfigDesc) String() string

func (*AlertConfigDesc) Unmarshal

func (m *AlertConfigDesc) Unmarshal(dAtA []byte) error

func (*AlertConfigDesc) XXX_DiscardUnknown

func (m *AlertConfigDesc) XXX_DiscardUnknown()

func (*AlertConfigDesc) XXX_Marshal

func (m *AlertConfigDesc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AlertConfigDesc) XXX_Merge

func (m *AlertConfigDesc) XXX_Merge(src proto.Message)

func (*AlertConfigDesc) XXX_Size

func (m *AlertConfigDesc) XXX_Size() int

func (*AlertConfigDesc) XXX_Unmarshal

func (m *AlertConfigDesc) XXX_Unmarshal(b []byte) error

type AlertConfigDescs

type AlertConfigDescs struct {
	Mimir   AlertConfigDesc
	Grafana GrafanaAlertConfigDesc
}

AlertConfigDescs is a wrapper for a Mimir and a Grafana Alertmanager configurations.

type FullStateDesc

type FullStateDesc struct {
	State *clusterpb.FullState `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"`
}

func (*FullStateDesc) Descriptor

func (*FullStateDesc) Descriptor() ([]byte, []int)

func (*FullStateDesc) GetState

func (m *FullStateDesc) GetState() *clusterpb.FullState

func (*FullStateDesc) GoString

func (this *FullStateDesc) GoString() string

func (*FullStateDesc) Marshal

func (m *FullStateDesc) Marshal() (dAtA []byte, err error)

func (*FullStateDesc) MarshalTo

func (m *FullStateDesc) MarshalTo(dAtA []byte) (int, error)

func (*FullStateDesc) MarshalToSizedBuffer

func (m *FullStateDesc) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*FullStateDesc) ProtoMessage

func (*FullStateDesc) ProtoMessage()

func (*FullStateDesc) Reset

func (m *FullStateDesc) Reset()

func (*FullStateDesc) Size

func (m *FullStateDesc) Size() (n int)

func (*FullStateDesc) String

func (this *FullStateDesc) String() string

func (*FullStateDesc) Unmarshal

func (m *FullStateDesc) Unmarshal(dAtA []byte) error

func (*FullStateDesc) XXX_DiscardUnknown

func (m *FullStateDesc) XXX_DiscardUnknown()

func (*FullStateDesc) XXX_Marshal

func (m *FullStateDesc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FullStateDesc) XXX_Merge

func (m *FullStateDesc) XXX_Merge(src proto.Message)

func (*FullStateDesc) XXX_Size

func (m *FullStateDesc) XXX_Size() int

func (*FullStateDesc) XXX_Unmarshal

func (m *FullStateDesc) XXX_Unmarshal(b []byte) error

type GrafanaAlertConfigDesc

type GrafanaAlertConfigDesc struct {
	User               string            `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	RawConfig          string            `protobuf:"bytes,2,opt,name=raw_config,json=rawConfig,proto3" json:"raw_config,omitempty"`
	Hash               string            `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"`
	CreatedAtTimestamp int64             `protobuf:"varint,5,opt,name=created_at_timestamp,json=createdAtTimestamp,proto3" json:"created_at_timestamp,omitempty"`
	Default            bool              `protobuf:"varint,7,opt,name=default,proto3" json:"default,omitempty"`
	Promoted           bool              `protobuf:"varint,8,opt,name=promoted,proto3" json:"promoted,omitempty"`
	ExternalUrl        string            `protobuf:"bytes,9,opt,name=external_url,json=externalUrl,proto3" json:"external_url,omitempty"`
	StaticHeaders      map[string]string `` /* 189-byte string literal not displayed */
}

func ToGrafanaProto

func ToGrafanaProto(cfg, user, hash string, createdAtTimestamp int64, isDefault, isPromoted bool, externalURL string, staticHeaders map[string]string) GrafanaAlertConfigDesc

ToGrafanaProto transforms a Grafana Alertmanager config to a GrafanaAlertConfigDesc.

func (*GrafanaAlertConfigDesc) Descriptor

func (*GrafanaAlertConfigDesc) Descriptor() ([]byte, []int)

func (*GrafanaAlertConfigDesc) GetCreatedAtTimestamp

func (m *GrafanaAlertConfigDesc) GetCreatedAtTimestamp() int64

func (*GrafanaAlertConfigDesc) GetDefault

func (m *GrafanaAlertConfigDesc) GetDefault() bool

func (*GrafanaAlertConfigDesc) GetExternalUrl

func (m *GrafanaAlertConfigDesc) GetExternalUrl() string

func (*GrafanaAlertConfigDesc) GetHash

func (m *GrafanaAlertConfigDesc) GetHash() string

func (*GrafanaAlertConfigDesc) GetPromoted

func (m *GrafanaAlertConfigDesc) GetPromoted() bool

func (*GrafanaAlertConfigDesc) GetRawConfig

func (m *GrafanaAlertConfigDesc) GetRawConfig() string

func (*GrafanaAlertConfigDesc) GetStaticHeaders

func (m *GrafanaAlertConfigDesc) GetStaticHeaders() map[string]string

func (*GrafanaAlertConfigDesc) GetUser

func (m *GrafanaAlertConfigDesc) GetUser() string

func (*GrafanaAlertConfigDesc) GoString

func (this *GrafanaAlertConfigDesc) GoString() string

func (*GrafanaAlertConfigDesc) Marshal

func (m *GrafanaAlertConfigDesc) Marshal() (dAtA []byte, err error)

func (*GrafanaAlertConfigDesc) MarshalTo

func (m *GrafanaAlertConfigDesc) MarshalTo(dAtA []byte) (int, error)

func (*GrafanaAlertConfigDesc) MarshalToSizedBuffer

func (m *GrafanaAlertConfigDesc) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GrafanaAlertConfigDesc) ProtoMessage

func (*GrafanaAlertConfigDesc) ProtoMessage()

func (*GrafanaAlertConfigDesc) Reset

func (m *GrafanaAlertConfigDesc) Reset()

func (*GrafanaAlertConfigDesc) Size

func (m *GrafanaAlertConfigDesc) Size() (n int)

func (*GrafanaAlertConfigDesc) String

func (this *GrafanaAlertConfigDesc) String() string

func (*GrafanaAlertConfigDesc) Unmarshal

func (m *GrafanaAlertConfigDesc) Unmarshal(dAtA []byte) error

func (*GrafanaAlertConfigDesc) XXX_DiscardUnknown

func (m *GrafanaAlertConfigDesc) XXX_DiscardUnknown()

func (*GrafanaAlertConfigDesc) XXX_Marshal

func (m *GrafanaAlertConfigDesc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GrafanaAlertConfigDesc) XXX_Merge

func (m *GrafanaAlertConfigDesc) XXX_Merge(src proto.Message)

func (*GrafanaAlertConfigDesc) XXX_Size

func (m *GrafanaAlertConfigDesc) XXX_Size() int

func (*GrafanaAlertConfigDesc) XXX_Unmarshal

func (m *GrafanaAlertConfigDesc) XXX_Unmarshal(b []byte) error

type TemplateDesc

type TemplateDesc struct {
	Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"`
	Body     string `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"`
}

func (*TemplateDesc) Descriptor

func (*TemplateDesc) Descriptor() ([]byte, []int)

func (*TemplateDesc) Equal

func (this *TemplateDesc) Equal(that interface{}) bool

func (*TemplateDesc) GetBody

func (m *TemplateDesc) GetBody() string

func (*TemplateDesc) GetFilename

func (m *TemplateDesc) GetFilename() string

func (*TemplateDesc) GoString

func (this *TemplateDesc) GoString() string

func (*TemplateDesc) Marshal

func (m *TemplateDesc) Marshal() (dAtA []byte, err error)

func (*TemplateDesc) MarshalTo

func (m *TemplateDesc) MarshalTo(dAtA []byte) (int, error)

func (*TemplateDesc) MarshalToSizedBuffer

func (m *TemplateDesc) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TemplateDesc) ProtoMessage

func (*TemplateDesc) ProtoMessage()

func (*TemplateDesc) Reset

func (m *TemplateDesc) Reset()

func (*TemplateDesc) Size

func (m *TemplateDesc) Size() (n int)

func (*TemplateDesc) String

func (this *TemplateDesc) String() string

func (*TemplateDesc) Unmarshal

func (m *TemplateDesc) Unmarshal(dAtA []byte) error

func (*TemplateDesc) XXX_DiscardUnknown

func (m *TemplateDesc) XXX_DiscardUnknown()

func (*TemplateDesc) XXX_Marshal

func (m *TemplateDesc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TemplateDesc) XXX_Merge

func (m *TemplateDesc) XXX_Merge(src proto.Message)

func (*TemplateDesc) XXX_Size

func (m *TemplateDesc) XXX_Size() int

func (*TemplateDesc) XXX_Unmarshal

func (m *TemplateDesc) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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