store

package
v0.0.0-...-398aefc Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeStore

type FakeStore struct {
	MessageIDs        []string
	SuccessMessageIDs []string
	ErroredMessageIDs []string
	DeletedMessageIDs []string
	RetryMessageIDs   []string
}

func (*FakeStore) Delete

func (s *FakeStore) Delete(id string) error

func (*FakeStore) Error

func (s *FakeStore) Error(id string, message string) error

func (*FakeStore) MarkForRetry

func (s *FakeStore) MarkForRetry(id string) error

func (*FakeStore) StoreHook

func (s *FakeStore) StoreHook(forwardURL string, body []byte, header map[string][]string) (string, error)

func (*FakeStore) Success

func (s *FakeStore) Success(id string) error

type Store

type Store interface {
	// StoreHook stores a webhook in the store.
	StoreHook(forwardURL string, body []byte, headers map[string][]string) (string, error)

	// Success marks a hook as successful.
	Success(id string) error

	// Marks a hook as error, with the error message.
	Error(id string, message string) error

	// Deletes a hook from the store.
	Delete(id string) error

	// Updates a hook to state it has been reattempted.
	MarkForRetry(id string) error
}

Store interface to implement a storage strategy.

func NewKubernetesStore

func NewKubernetesStore() Store

Jump to

Keyboard shortcuts

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