Documentation ¶
Index ¶
- Variables
- type ApiKey
- type ApiKeyID
- type ApiKeyRepository
- type Application
- type ApplicationID
- type ApplicationRepository
- type Endpoint
- func (e *Endpoint) ApplicationID() ApplicationID
- func (e *Endpoint) CreatedAt() time.Time
- func (e *Endpoint) Description() string
- func (e *Endpoint) EndpointURL() EndpointURL
- func (e *Endpoint) EventTypeIDs() []EventTypeID
- func (e *Endpoint) Headers() map[string]string
- func (e *Endpoint) ID() EndpointID
- func (e *Endpoint) SigningSecret() SigningSecret
- func (e *Endpoint) UpdatedAt() time.Time
- type EndpointID
- type EndpointRepository
- type EndpointURL
- type EnvType
- type Environment
- type EnvironmentID
- type EnvironmentRepository
- type EventType
- func (e *EventType) ArchivedAt() *time.Time
- func (e *EventType) CreatedAt() time.Time
- func (e *EventType) Description() string
- func (e *EventType) ID() EventTypeID
- func (e *EventType) Name() string
- func (e *EventType) OrgID() string
- func (e *EventType) Schema() string
- func (e *EventType) SchemaExample() string
- type EventTypeID
- type EventTypeRepository
- type Headers
- type ID
- type Message
- type MessageID
- type MessageRepository
- type MessageSendAttempt
- func (m *MessageSendAttempt) EndpointID() EndpointID
- func (m *MessageSendAttempt) ID() MsgSendAttemptID
- func (m *MessageSendAttempt) MessageID() MessageID
- func (m *MessageSendAttempt) RequestHeaders() Headers
- func (m *MessageSendAttempt) Response() string
- func (m *MessageSendAttempt) Status() SendAttemptStatus
- func (m *MessageSendAttempt) StatusCode() StatusCode
- func (m *MessageSendAttempt) Timestamp() time.Time
- type MsgSendAttemptID
- type SecretKey
- type SendAttemptStatus
- type SigningSecret
- type StatusCode
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EnvTypeProduction = EnvType{"production"} EnvTypeDevelopment = EnvType{"development"} )
View Source
var ( ErrApiKeyExists = errors.New("the api key already exists") ErrApiKeyNotFound = errors.New("api key not found") ErrAppNotFound = errors.New("application not found") ErrEndpointNotFound = errors.New("endpoint not found") ErrEventTypeNotFound = errors.New("event type not found") ErrMessageNotFound = errors.New("message not found") ErrEnvironmentNotFound = errors.New("environment not found") )
View Source
var (
ErrApiKeyIsExpired = errors.New("api key is expired")
)
Functions ¶
This section is empty.
Types ¶
type ApiKey ¶
type ApiKey struct {
// contains filtered or unexported fields
}
func UnMarshallApiKey ¶
func (*ApiKey) EnvID ¶
func (a *ApiKey) EnvID() EnvironmentID
type ApiKeyRepository ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
func NewApplication ¶
func NewApplication(name string, envID EnvironmentID) (*Application, error)
func UnMarshallApplication ¶
func UnMarshallApplication(id ApplicationID, name string, envID EnvironmentID, createdAt time.Time) *Application
func (*Application) CreatedAt ¶
func (a *Application) CreatedAt() time.Time
func (*Application) EnvID ¶
func (a *Application) EnvID() EnvironmentID
func (*Application) ID ¶
func (a *Application) ID() ApplicationID
func (*Application) Name ¶
func (a *Application) Name() string
type ApplicationID ¶
type ApplicationID string
func NewApplicationID ¶
func NewApplicationID() ApplicationID
func (ApplicationID) String ¶
func (i ApplicationID) String() string
type ApplicationRepository ¶
type ApplicationRepository interface {
Insert(ctx context.Context, application *Application) error
}
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
func NewEndpoint ¶
func NewEndpoint( endpointURL EndpointURL, applicationID ApplicationID, description string, eventTypeIDs []EventTypeID, ) (*Endpoint, error)
func UnMarshallEndpoint ¶
func UnMarshallEndpoint( id EndpointID, applicationID ApplicationID, endpointURL, description string, headers Headers, eventTypeIDs []EventTypeID, signingSecret string, createdAt, updatedAt time.Time, ) (*Endpoint, error)
func (*Endpoint) ApplicationID ¶
func (e *Endpoint) ApplicationID() ApplicationID
func (*Endpoint) Description ¶
func (*Endpoint) EndpointURL ¶
func (e *Endpoint) EndpointURL() EndpointURL
func (*Endpoint) EventTypeIDs ¶
func (e *Endpoint) EventTypeIDs() []EventTypeID
func (*Endpoint) ID ¶
func (e *Endpoint) ID() EndpointID
func (*Endpoint) SigningSecret ¶
func (e *Endpoint) SigningSecret() SigningSecret
type EndpointID ¶
type EndpointID string
func NewEndpointID ¶
func NewEndpointID() EndpointID
func (EndpointID) String ¶
func (i EndpointID) String() string
type EndpointRepository ¶
type EndpointRepository interface { Insert(ctx context.Context, endpoint *Endpoint) error ByID(ctx context.Context, id EndpointID) (*Endpoint, error) ByEventTypeIdOrAppID(ctx context.Context, eventTypeID *EventTypeID, appID ApplicationID) ([]*Endpoint, error) }
type EndpointURL ¶
type EndpointURL struct {
// contains filtered or unexported fields
}
func NewEndpointURL ¶
func NewEndpointURL(rawURL string) (EndpointURL, error)
func (EndpointURL) IsEmpty ¶
func (e EndpointURL) IsEmpty() bool
func (EndpointURL) String ¶
func (e EndpointURL) String() string
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
func NewEnvironment ¶
func NewEnvironment(name string, orgID string, envType EnvType) (*Environment, error)
func UnMarshallEnvironment ¶
func UnMarshallEnvironment( id EnvironmentID, orgID, name, envType string, createdAt time.Time, archivedAt *time.Time, ) (*Environment, error)
func (*Environment) ArchivedAt ¶
func (e *Environment) ArchivedAt() *time.Time
func (*Environment) CreatedAt ¶
func (e *Environment) CreatedAt() time.Time
func (*Environment) ID ¶
func (e *Environment) ID() EnvironmentID
func (*Environment) Name ¶
func (e *Environment) Name() string
func (*Environment) OrgID ¶
func (e *Environment) OrgID() string
func (*Environment) Type ¶
func (e *Environment) Type() EnvType
type EnvironmentID ¶
type EnvironmentID string
func NewEnvironmentID ¶
func NewEnvironmentID() EnvironmentID
func (EnvironmentID) String ¶
func (i EnvironmentID) String() string
type EnvironmentRepository ¶
type EnvironmentRepository interface { ByID(ctx context.Context, id EnvironmentID) (*Environment, error) Insert(ctx context.Context, env *Environment) error FindAll(ctx context.Context, orgID string) ([]*Environment, error) }
type EventType ¶
type EventType struct {
// contains filtered or unexported fields
}
func NewEventType ¶
func UnMarshallEventType ¶
func (*EventType) ArchivedAt ¶
func (*EventType) Description ¶
func (*EventType) ID ¶
func (e *EventType) ID() EventTypeID
func (*EventType) SchemaExample ¶
type EventTypeID ¶
type EventTypeID string
func NewEventTypeID ¶
func NewEventTypeID() EventTypeID
func (EventTypeID) String ¶
func (i EventTypeID) String() string
type EventTypeRepository ¶
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func NewMessage ¶
func NewMessage(eventTypeID *EventTypeID, orgID string, applicationID ApplicationID, payload string) (*Message, error)
func UnMarshallMessage ¶
func UnMarshallMessage( id MessageID, eventTypeID *EventTypeID, applicationID ApplicationID, orgID string, sentAt time.Time, payload string, ) (*Message, error)
func (*Message) ApplicationID ¶
func (m *Message) ApplicationID() ApplicationID
func (*Message) EventTypeID ¶
func (m *Message) EventTypeID() *EventTypeID
func (*Message) SendAttempts ¶
func (m *Message) SendAttempts() []MessageSendAttempt
type MessageRepository ¶
type MessageSendAttempt ¶
type MessageSendAttempt struct {
// contains filtered or unexported fields
}
func NewMessageSendAttempt ¶
func NewMessageSendAttempt( endpointID EndpointID, messageID MessageID, response string, statusCode StatusCode, requestHeaders Headers, ) (*MessageSendAttempt, error)
func (*MessageSendAttempt) EndpointID ¶
func (m *MessageSendAttempt) EndpointID() EndpointID
func (*MessageSendAttempt) ID ¶
func (m *MessageSendAttempt) ID() MsgSendAttemptID
func (*MessageSendAttempt) MessageID ¶
func (m *MessageSendAttempt) MessageID() MessageID
func (*MessageSendAttempt) RequestHeaders ¶
func (m *MessageSendAttempt) RequestHeaders() Headers
func (*MessageSendAttempt) Response ¶
func (m *MessageSendAttempt) Response() string
func (*MessageSendAttempt) Status ¶
func (m *MessageSendAttempt) Status() SendAttemptStatus
func (*MessageSendAttempt) StatusCode ¶
func (m *MessageSendAttempt) StatusCode() StatusCode
func (*MessageSendAttempt) Timestamp ¶
func (m *MessageSendAttempt) Timestamp() time.Time
type MsgSendAttemptID ¶
type MsgSendAttemptID string
func NewMsgSendAttemptID ¶
func NewMsgSendAttemptID() MsgSendAttemptID
func (MsgSendAttemptID) String ¶
func (i MsgSendAttemptID) String() string
type SecretKey ¶
type SecretKey struct {
// contains filtered or unexported fields
}
func UnMarshallSecretKey ¶
type SendAttemptStatus ¶
type SendAttemptStatus string
func (SendAttemptStatus) String ¶
func (s SendAttemptStatus) String() string
type SigningSecret ¶
type SigningSecret struct {
// contains filtered or unexported fields
}
func NewSigningSecret ¶
func NewSigningSecret() (SigningSecret, error)
func UnMarshallSigningSecret ¶
func UnMarshallSigningSecret(value string) (SigningSecret, error)
func (SigningSecret) IsEmpty ¶
func (s SigningSecret) IsEmpty() string
func (SigningSecret) String ¶
func (s SigningSecret) String() string
func (SigningSecret) UnEncoded ¶
func (s SigningSecret) UnEncoded() ([]byte, error)
type StatusCode ¶
type StatusCode uint
Source Files ¶
Click to show internal directories.
Click to hide internal directories.