notification

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PathCreateEvent             string = "/createMaintenanceEvent"
	PathUpdateEvent             string = "/updateMaintenanceEvent"
	PathCancelEvent             string = "/cancelMaintenanceEvent"
	KubernetesMaintenanceNumber string = "0"
	KymaMaintenanceNumber       string = "1"
	UnderMaintenanceEventState  string = "1"
	FinishedMaintenanceState    string = "2"
	CancelledMaintenanceState   string = "3"
)
View Source
const (
	FakeOrchestrationID = "ASKHGK-SAKJHTJ-ALKJSHT-HUZIUOP"
	FakeInstanceID      = "WEAJKG-INSTANCE-1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

func (*Builder) NewBundle

func (b *Builder) NewBundle(identifier string, notificationParams NotificationParams) (Bundle, error)

type Bundle

type Bundle interface {
	CreateNotificationEvent() error
	UpdateNotificationEvent() error
	CancelNotificationEvent() error
}

type BundleBuilder

type BundleBuilder interface {
	NewBundle(identifier string, notificationParams NotificationParams) (Bundle, error)
}

func NewBundleBuilder

func NewBundleBuilder(notificationClient NotificationClient, config Config) BundleBuilder

type CancelEventRequest

type CancelEventRequest struct {
	OrchestrationID string `json:"orchestrationId"`
}

type Client

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

func NewClient

func NewClient(cli *http.Client, cfg ClientConfig) *Client

func (*Client) CancelEvent

func (c *Client) CancelEvent(payload CancelEventRequest) error

func (*Client) CreateEvent

func (c *Client) CreateEvent(payload CreateEventRequest) error

func (*Client) UpdateEvent

func (c *Client) UpdateEvent(payload UpdateEventRequest) error

type ClientConfig

type ClientConfig struct {
	URL string
}

type Config

type Config struct {
	Url string `envconfig:"default="`
}

type CreateEventRequest

type CreateEventRequest struct {
	OrchestrationID string               `json:"orchestrationId"`
	EventType       string               `json:"eventType"`
	Tenants         []NotificationTenant `json:"tenants"`
}

type FakeClient

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

func NewFakeClient

func NewFakeClient() *FakeClient

func (*FakeClient) CancelEvent

func (f *FakeClient) CancelEvent(request CancelEventRequest) error

func (*FakeClient) CreateEvent

func (f *FakeClient) CreateEvent(request CreateEventRequest) error

func (*FakeClient) GetMaintenanceEvent

func (f *FakeClient) GetMaintenanceEvent(id string) (*MaintenanceEvent, error)

func (*FakeClient) UpdateEvent

func (f *FakeClient) UpdateEvent(request UpdateEventRequest) error

type MaintenanceEvent

type MaintenanceEvent struct {
	OrchestrationID string
	EventType       string
	Tenants         []Tenants
}

type NotificationBundle

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

func NewNotificationBundle

func NewNotificationBundle(bundleIdentifier string, notificationParams NotificationParams, c NotificationClient, cfg Config) *NotificationBundle

func (*NotificationBundle) CancelNotificationEvent

func (b *NotificationBundle) CancelNotificationEvent() error

func (*NotificationBundle) CreateNotificationEvent

func (b *NotificationBundle) CreateNotificationEvent() error

func (*NotificationBundle) UpdateNotificationEvent

func (b *NotificationBundle) UpdateNotificationEvent() error

type NotificationClient

type NotificationClient interface {
	CreateEvent(CreateEventRequest) error
	UpdateEvent(UpdateEventRequest) error
	CancelEvent(CancelEventRequest) error
}

type NotificationParams

type NotificationParams struct {
	OrchestrationID string               `json:"orchestrationId"`
	EventType       string               `json:"eventType"`
	Tenants         []NotificationTenant `json:"tenants"`
}

type NotificationTenant

type NotificationTenant struct {
	InstanceID string `json:"instanceId"`
	StartDate  string `json:"startDateTime,omitempty"`
	EndDate    string `json:"endDateTime,omitempty"`
	State      string `json:"eventState,omitempty"`
}

type Request

type Request struct {
	Method  string
	Path    string
	Body    io.Reader
	Headers map[string]string
	Delete  bool
}

type Tenants

type Tenants struct {
	InstanceID string
	StartDate  string
	EndDate    string
	State      string
}

type UpdateEventRequest

type UpdateEventRequest struct {
	OrchestrationID string               `json:"orchestrationId"`
	Tenants         []NotificationTenant `json:"tenants"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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