storage

package
v0.0.0-...-8aa8f09 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaintenanceEventType EventType = "maintenance"
	IncidentEventType    EventType = "incident"
	NoticeEventType      EventType = "notice"
	UnknownEventType     EventType = "unknown"

	ActiveEventState   EventState = "active"
	FinishedEventState EventState = "finished"
	UnknownEventState  EventState = "unknown"
)

Variables

Functions

This section is empty.

Types

type Event

type Event interface {
	Id() string
	Type() EventType
	State() EventState
	Service() string
	Title() string
	Description() string
	Labels() []string
	ResponsiblePerson() User
	Start() time.Time
	End() time.Time
	NumberOfComments() int
}

type EventComment

type EventComment interface {
	Id() string
	Author() User
	Text() string
	CreatedAt() time.Time
}

type EventFilter

type EventFilter struct {
	Limit      int
	Since      time.Time
	Until      time.Time
	EventTypes []EventType
}

type EventState

type EventState string

type EventType

type EventType string

type NewEventCommentOpts

type NewEventCommentOpts struct {
	Text string
}

type NewEventOpts

type NewEventOpts struct {
	Type        EventType
	Title       string
	Description string
	Labels      []string
	Start       time.Time
	End         time.Time
}

type Opts

type Opts struct {
	StoreType *string

	OAuthAppKeyFile    *string
	OAuthSecretKeyFile *string
	OAuthCallbackUrl   *string

	GitlabBaseUrl   *string
	GitlabTokenFile *string
	GitlabProject   *string
}

type Storage

type Storage interface {
	prometheus.Collector
	fmt.Stringer
	NewEvent(ctx context.Context, token string, eventOpts NewEventOpts) error
	Events(ctx context.Context, filter EventFilter) ([]Event, error)
	Event(ctx context.Context, eventId string) (Event, error)

	NewEventComment(ctx context.Context, token string, eventId string, commentOpts NewEventCommentOpts) error
	EventComments(ctx context.Context, eventId string) ([]EventComment, error)
}

func New

func New(config config.StorageConfig) (Storage, error)

type StoreType

type StoreType string
const (
	GitLab StoreType = "gitlab"
)

type User

type User interface {
	Name() string
	Email() string
	AvatarUrl() string
}

Jump to

Keyboard shortcuts

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