alerts

package
v0.0.0-...-cae4bf4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

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 config not found")
)

Functions

func ParseTemplates

func ParseTemplates(cfg AlertConfigDesc) map[string]string

ParseTemplates returns a 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, error)

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 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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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