domain

package
v0.0.0-...-0314968 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IError

type IError interface {
	// Message returns the user world error message.  This must not leak
	// internal system details.
	Message() string

	// IsFatal defines if the error is transient and may be retried.
	IsFatal() bool

	// User world error code.  Use HTTPStatusCode for ease of use.
	StatusCode() int

	// Returns the actual error message.  This should be populated from the
	// source error.
	Error() string

	// System level error code.  These internal error codes can be
	// sent to the user world for pin pointing the error source.
	SystemCode() string
}

IError is the base error interface used across the project. This can be accepted as a standard `error` since it implements Error() method.

type Message

type Message struct {
	ID               string      `json:"id"`
	Payload          interface{} `json:"payload"`
	Ok               bool        `json:"ok"`
	ProviderResponse interface{} `json:"provider_response,omitempty"`
}

type Messages

type Messages []Message

type Notifier

type Notifier struct {
	ID          string                 `json:"id,omitempty"`
	Config      *NotifierConfiguration `json:"config,omitempty"`
	TenantID    string                 `json:"tenant_id,omitempty"`
	DateCreated time.Time              `json:"date_created,omitempty"`
	DateUpdated time.Time              `json:"date_updated,omitempty"`
	Type        ProviderType           `json:"type"`
}

type NotifierConfiguration

type NotifierConfiguration struct {
	Secret *NotifierSecret        `json:"secret"`
	Opts   map[string]interface{} `json:"options"`
}

type NotifierRepository

type NotifierRepository interface{}

type NotifierSecret

type NotifierSecret struct {
	Token string `json:"token"`
}

type ProviderType

type ProviderType string

type Template

type Template struct {
	ID                 string         `json:"id,omitempty"`
	Pattern            string         `json:"pattern,omitempty"`
	Type               TemplateType   `json:"type,omitempty"`
	DateCreated        time.Time      `json:"date_created,omitempty"`
	DateUpdated        time.Time      `json:"date_updated,omitempty"`
	SupportedProviders []ProviderType `json:"supported_providers"`
}

func (*Template) GetTemplater

func (t *Template) GetTemplater() Templater

func (*Template) IsSupported

func (t *Template) IsSupported(provider ProviderType) bool

type TemplateRepository

type TemplateRepository interface {
	Create(ctx context.Context, template *Template) IError
	GetByID(ctx context.Context, id string) (*Template, IError)
}

type TemplateType

type TemplateType string
const (
	TemplateTypeText       TemplateType = "text"
	TemplateTypeMustache   TemplateType = "mustache"
	TemplateTypeGoTemplate TemplateType = "gotmpl"
)

type Templater

type Templater interface {
	Execute(pattern string, params interface{}) ([]byte, error)
}

Jump to

Keyboard shortcuts

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