models

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResponse

type APIResponse struct {
	Status  bool             `json:"status"`
	Message string           `json:"message"`
	Data    *json.RawMessage `json:"data,omitempty"`
}

type AppMetadata

type AppMetadata struct {
	OrgID  string `json:"org_id"`
	Secret string `json:"secret"`

	Endpoints []EndpointMetadata `json:"endpoints"`
}

type ApplicationRequest

type ApplicationRequest struct {
	OrgID   string `json:"org_id" bson:"org_id"`
	AppName string `json:"name" bson:"name"`

	// Secret - Custom secret for App. If none is passed, it is generated on the API
	Secret string `json:"secret" bson:"secret"`
}

type ApplicationResponse

type ApplicationResponse struct {
	OrgID string `json:"org_id"`

	Secret    string             `json:"secret"`
	Endpoints []EndpointResponse `json:"endpoints"`

	UID  string `json:"uid"`
	Name string `json:"name"`

	CreatedAt time.Time `json:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	DeletedAt time.Time `json:"deleted_at,omitempty"`

	Events int64 `json:"events"`
}

type EndpointMetadata

type EndpointMetadata struct {
	UID       string `json:"uid"`
	TargetURL string `json:"target_url"`

	Sent bool `json:"sent"`
}

type EndpointRequest

type EndpointRequest struct {
	URL         string `json:"url"`
	Description string `json:"description"`
}

type EndpointResponse

type EndpointResponse struct {
	UID         string `json:"uid"`
	TargetURL   string `json:"target_url"`
	Description string `json:"description"`

	CreatedAt time.Time `json:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	DeletedAt time.Time `json:"deleted_at,omitempty"`
}

type EventRequest

type EventRequest struct {
	AppID string          `json:"app_id"`
	Event string          `json:"event_type" bson:"event_type"`
	Data  json.RawMessage `json:"data" bson:"data"`
}

type EventResponse

type EventResponse struct {
	UID       string `json:"uid"`
	AppID     string `json:"app_id"`
	EventType string `json:"event_type"`

	ProviderID string `json:"provider_id"`

	Data json.RawMessage `json:"data"`

	Metadata *MessageMetadata `json:"metadata"`

	Description string `json:"description,omitempty"`

	Status string `json:"status"`

	AppMetadata *AppMetadata `json:"app_metadata,omitempty"`

	CreatedAt time.Time `json:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	DeletedAt time.Time `json:"deleted_at,omitempty"`
}

type MessageMetadata

type MessageMetadata struct {
	Strategy string `json:"strategy"`

	NextSendTime time.Time `json:"next_send_time"`

	NumTrials       uint64 `json:"num_trials"`
	IntervalSeconds uint64 `json:"interval_seconds"`
	RetryLimit      uint64 `json:"retry_limit"`
}

Jump to

Keyboard shortcuts

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