domain

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: BSD-2-Clause Imports: 3 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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