entities

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadOpenAPI added in v0.8.0

func LoadOpenAPI(bytes []byte)

func LookupSchema added in v0.8.0

func LookupSchema(name string) *openapi3.Schema

Types

type Attempt

type Attempt struct {
	ID            string             `json:"id" db:"id"`
	EventId       string             `json:"event_id" db:"event_id"`
	EndpointId    string             `json:"endpoint_id" db:"endpoint_id"`
	Status        AttemptStatus      `json:"status" db:"status"`
	AttemptNumber int                `json:"attempt_number" db:"attempt_number"`
	ScheduledAt   types.Time         `json:"scheduled_at" db:"scheduled_at"`
	AttemptedAt   *types.Time        `json:"attempted_at" db:"attempted_at"`
	TriggerMode   AttemptTriggerMode `json:"trigger_mode" db:"trigger_mode"`
	Exhausted     bool               `json:"exhausted" db:"exhausted"`

	ErrorCode *AttemptErrorCode `json:"error_code" db:"error_code"`
	Request   *AttemptRequest   `json:"request" db:"request"`
	Response  *AttemptResponse  `json:"response" db:"response"`

	Event *Event `json:"-" db:"-"`

	BaseModel
}

type AttemptDetail added in v0.2.0

type AttemptDetail struct {
	ID              string   `json:"id" db:"id"`
	RequestHeaders  Headers  `json:"request_headers" db:"request_headers"`
	RequestBody     *string  `json:"request_body" db:"request_body"`
	ResponseHeaders *Headers `json:"response_headers" db:"response_headers"`
	ResponseBody    *string  `json:"response_body" db:"response_body"`

	BaseModel
}

type AttemptErrorCode

type AttemptErrorCode = string
const (
	AttemptErrorCodeTimeout          AttemptErrorCode = "TIMEOUT"
	AttemptErrorCodeUnknown          AttemptErrorCode = "UNKNOWN"
	AttemptErrorCodeEndpointDisabled AttemptErrorCode = "ENDPOINT_DISABLED"
	AttemptErrorCodeDenied           AttemptErrorCode = "DENIED"
	AttemptErrorCodeEndpointNotFound AttemptErrorCode = "ENDPOINT_NOT_FOUND"
)

type AttemptRequest

type AttemptRequest struct {
	Method  string  `json:"method"`
	URL     string  `json:"url"`
	Headers Headers `json:"headers"`
	Body    *string `json:"body"`
}

func (*AttemptRequest) Scan

func (m *AttemptRequest) Scan(src interface{}) error

func (AttemptRequest) Value

func (m AttemptRequest) Value() (driver.Value, error)

type AttemptResponse

type AttemptResponse struct {
	Status  int     `json:"status"`
	Latency int64   `json:"latency"`
	Headers Headers `json:"headers"`
	Body    *string `json:"body"`
}

func (*AttemptResponse) Scan

func (m *AttemptResponse) Scan(src interface{}) error

func (AttemptResponse) Value

func (m AttemptResponse) Value() (driver.Value, error)

type AttemptStatus

type AttemptStatus = string
const (
	AttemptStatusInit     AttemptStatus = "INIT"
	AttemptStatusQueued   AttemptStatus = "QUEUED"
	AttemptStatusSuccess  AttemptStatus = "SUCCESSFUL"
	AttemptStatusFailure  AttemptStatus = "FAILED"
	AttemptStatusCanceled AttemptStatus = "CANCELED"
)

type AttemptTriggerMode added in v0.2.0

type AttemptTriggerMode = string
const (
	AttemptTriggerModeInitial   AttemptTriggerMode = "INITIAL"
	AttemptTriggerModeManual    AttemptTriggerMode = "MANUAL"
	AttemptTriggerModeAutomatic AttemptTriggerMode = "AUTOMATIC"
)

type BaseModel

type BaseModel struct {
	CreatedAt   *types.Time `db:"created_at" json:"created_at,omitempty"`
	UpdatedAt   *types.Time `db:"updated_at" json:"updated_at,omitempty"`
	WorkspaceId string      `db:"ws_id" json:"-"`
}

type CustomResponse

type CustomResponse struct {
	Code        int    `json:"code"`
	ContentType string `json:"content_type"`
	Body        string `json:"body"`
}

func (*CustomResponse) Scan

func (m *CustomResponse) Scan(src interface{}) error

func (CustomResponse) Value

func (m CustomResponse) Value() (driver.Value, error)

type Endpoint

type Endpoint struct {
	ID          string        `json:"id" db:"id"`
	Name        *string       `json:"name" db:"name"`
	Description *string       `json:"description" db:"description"`
	Enabled     bool          `json:"enabled" db:"enabled"`
	Request     RequestConfig `json:"request" db:"request"`
	Retry       Retry         `json:"retry" db:"retry"`
	Events      Strings       `json:"events" db:"events"`
	Metadata    Metadata      `json:"metadata" db:"metadata"`
	RateLimit   *RateLimit    `json:"rate_limit" db:"rate_limit"`

	Plugins []*Plugin `json:"-" db:"-"`

	BaseModel
}

func (*Endpoint) SchemaName added in v0.8.0

func (m *Endpoint) SchemaName() string

type Event

type Event struct {
	ID         string          `json:"id" validate:"required"`
	EventType  string          `json:"event_type" db:"event_type" validate:"required"`
	Data       json.RawMessage `json:"data" validate:"required"`
	IngestedAt types.Time      `json:"ingested_at" db:"ingested_at"`
	UniqueId   *string         `json:"unique_id" db:"unique_id" validate:"omitempty,max=50"`

	BaseModel
}

func (*Event) SchemaName added in v0.8.0

func (m *Event) SchemaName() string

func (*Event) Validate

func (m *Event) Validate() error

type FixedStrategyConfig

type FixedStrategyConfig struct {
	Attempts []int64 `json:"attempts"`
}

type Headers added in v0.2.0

type Headers map[string]string

func (*Headers) Scan added in v0.2.0

func (m *Headers) Scan(src interface{}) error

func (*Headers) UnmarshalJSON added in v0.8.0

func (m *Headers) UnmarshalJSON(data []byte) error

func (Headers) Value added in v0.2.0

func (m Headers) Value() (driver.Value, error)

type HttpSourceConfig added in v1.0.0

type HttpSourceConfig struct {
	Path     string          `json:"path"`
	Methods  Strings         `json:"methods"`
	Response *CustomResponse `json:"response"`
}

type Metadata

type Metadata map[string]string

func (*Metadata) Scan

func (m *Metadata) Scan(src interface{}) error

func (*Metadata) UnmarshalJSON added in v0.8.0

func (m *Metadata) UnmarshalJSON(data []byte) error

func (Metadata) Value

func (m Metadata) Value() (driver.Value, error)

type Plugin added in v0.2.0

type Plugin struct {
	ID         string              `json:"id" db:"id"`
	Name       string              `json:"name" db:"name"`
	Enabled    bool                `json:"enabled" db:"enabled"`
	EndpointId *string             `json:"endpoint_id" db:"endpoint_id"`
	SourceId   *string             `json:"source_id" db:"source_id"`
	Config     PluginConfiguration `json:"config" db:"config"`
	Metadata   Metadata            `json:"metadata" db:"metadata"`

	BaseModel
}

func (*Plugin) SchemaName added in v0.8.0

func (m *Plugin) SchemaName() string

func (*Plugin) ToPlugin added in v1.0.0

func (m *Plugin) ToPlugin() (plugin.Plugin, error)

func (*Plugin) Validate added in v0.2.0

func (m *Plugin) Validate() error

type PluginConfiguration added in v0.4.0

type PluginConfiguration map[string]interface{}

func (*PluginConfiguration) Scan added in v1.0.0

func (m *PluginConfiguration) Scan(src interface{}) error

func (*PluginConfiguration) UnmarshalJSON added in v0.4.0

func (m *PluginConfiguration) UnmarshalJSON(data []byte) error

func (PluginConfiguration) Value added in v1.0.0

func (m PluginConfiguration) Value() (driver.Value, error)

type RateLimit added in v0.9.0

type RateLimit struct {
	Quota  int `json:"quota"`
	Period int `json:"period"`
}

func (*RateLimit) Scan added in v0.9.0

func (m *RateLimit) Scan(src interface{}) error

func (RateLimit) Value added in v0.9.0

func (m RateLimit) Value() (driver.Value, error)

type RequestConfig

type RequestConfig struct {
	URL     string  `json:"url"`
	Method  string  `json:"method"`
	Headers Headers `json:"headers"`
	Timeout int64   `json:"timeout"`
}

func (*RequestConfig) Scan

func (m *RequestConfig) Scan(src interface{}) error

func (RequestConfig) Value

func (m RequestConfig) Value() (driver.Value, error)

type Retry

type Retry struct {
	Strategy RetryStrategy       `json:"strategy"`
	Config   FixedStrategyConfig `json:"config"`
}

func (*Retry) Scan

func (m *Retry) Scan(src interface{}) error

func (Retry) Value

func (m Retry) Value() (driver.Value, error)

type RetryStrategy

type RetryStrategy string
const (
	RetryStrategyFixed RetryStrategy = "fixed"
)

func (RetryStrategy) String

func (m RetryStrategy) String() string

type Schema added in v0.8.0

type Schema interface {
	SchemaName() string
}

type Source

type Source struct {
	ID        string       `json:"id" db:"id"`
	Name      *string      `json:"name" db:"name"`
	Enabled   bool         `json:"enabled" db:"enabled"`
	Type      string       `json:"type" db:"type"`
	Config    SourceConfig `json:"config" db:"config"`
	Async     bool         `json:"async" db:"async"`
	Metadata  Metadata     `json:"metadata" db:"metadata"`
	RateLimit *RateLimit   `json:"rate_limit" db:"rate_limit"`

	Plugins []*Plugin `json:"-" db:"-"`

	BaseModel
}

func (*Source) SchemaName added in v0.8.0

func (m *Source) SchemaName() string

type SourceConfig added in v1.0.0

type SourceConfig struct {
	HTTP HttpSourceConfig `json:"http"`
}

func (*SourceConfig) Scan added in v1.0.0

func (m *SourceConfig) Scan(src interface{}) error

func (SourceConfig) Value added in v1.0.0

func (m SourceConfig) Value() (driver.Value, error)

type Strings added in v0.6.0

type Strings = pq.StringArray

type Workspace

type Workspace struct {
	ID          string   `json:"id" db:"id"`
	Name        *string  `json:"name" db:"name"`
	Description *string  `json:"description" db:"description"`
	Metadata    Metadata `json:"metadata" db:"metadata"`

	CreatedAt types.Time `db:"created_at" json:"created_at"`
	UpdatedAt types.Time `db:"updated_at" json:"updated_at"`
}

func (*Workspace) SchemaName added in v0.8.0

func (m *Workspace) SchemaName() string

Jump to

Keyboard shortcuts

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