Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNullSecureStore specifies that a SecureStorage is required. ErrNullSecureStore = errors.New("secure store must not be null") // ErrNullHTTPClient specifies that a HTTP client is required. ErrNullHTTPClient = errors.New("http client must not be null") // ErrUnknownWebhookAction specifies that the given string does not represent // any known action. ErrUnknownWebhookAction = errors.New("action is unknown") // ErrInvalidArgs specifies that the provided args do not properly represent a // Webhook. ErrInvalidArgs = errors.New( "webhook info must be serialized as a stringified JSON", ) // ErrInvalidArgType specifies that the provided arg is not of the expected // type. ErrInvalidArgType = errors.New("arg type must be string") // ErrInvalidTopic is returned whenever attempting to subscribe to an unknown // topic. ErrInvalidTopic = errors.New("topic is invalid") )
Functions ¶
func NewWebhookPubSubService ¶
func NewWebhookPubSubService( store securestore.SecureStorage, httpClient *esplora.Client, ) (ports.SecurePubSub, error)
Types ¶
type Webhook ¶
type Webhook struct { ID string `json:"id"` ActionType WebhookAction `json:"action_type"` Endpoint string `json:"endpoint"` Secret string `json:"secret"` }
func NewWebhook ¶
func NewWebhook(actionType WebhookAction, endpoint, secret string) (*Webhook, error)
func NewWebhookFromBytes ¶
type WebhookAction ¶
type WebhookAction int
const ( TradeSettled WebhookAction = iota AccountLowBalance AccountWithdraw AllActions )
webhook action types
func WebhookActionFromString ¶
func WebhookActionFromString(actionStr string) (WebhookAction, bool)
func (WebhookAction) Code ¶
func (wa WebhookAction) Code() int
func (WebhookAction) Label ¶
func (wa WebhookAction) Label() string
func (WebhookAction) String ¶
func (wa WebhookAction) String() string
Click to show internal directories.
Click to hide internal directories.