notifier

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayToString added in v1.0.0

func ArrayToString(array []string, sep string) string

func DoHttpRequest

func DoHttpRequest(ctx context.Context, client *http.Client, request *http.Request) ([]byte, error)

func Filter

func Filter(data template.Data, selector *v1.LabelSelector, logger log.Logger) template.Data

Filter the notifications with label selector,if the selector is not correct, return all of the notifications.

func KvToLabelSet

func KvToLabelSet(obj template.KV) model.LabelSet

func Len

func Len(s string) int

When a string is serialized, the escape character in the string will occupy two bytes because of `\`.

func Md5key

func Md5key(val interface{}) (string, error)

func UrlWithParameters

func UrlWithParameters(u string, parameters map[string]string) (string, error)

func UrlWithPath

func UrlWithPath(u, path string) (string, error)

Types

type AccessTokenService

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

func GetAccessTokenService

func GetAccessTokenService() *AccessTokenService

func (*AccessTokenService) GetToken

func (ats *AccessTokenService) GetToken(ctx context.Context, key string, getToken func(ctx context.Context) (string, time.Duration, error)) (string, error)

func (*AccessTokenService) InvalidToken

func (ats *AccessTokenService) InvalidToken(ctx context.Context, key string, l log.Logger)

type Notifier

type Notifier interface {
	Notify(ctx context.Context, data template.Data) []error
}

type Template

type Template struct {
	Tmpl *template.Template
	// contains filtered or unexported fields
}

func NewTemplate

func NewTemplate(paths []string) (*Template, error)

func (*Template) Split

func (t *Template) Split(data template.Data, maxSize int, templateName string, l log.Logger) ([]string, error)

func (*Template) TempleText

func (t *Template) TempleText(name string, data template.Data, l log.Logger) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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