entities

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 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"
	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"`
	UpdatedAt   types.Time `db:"updated_at" json:"updated_at"`
	WorkspaceId string     `db:"ws_id" json:"-"`
}

type CustomResponse

type CustomResponse struct {
	Code        int    `json:"code"`
	ContentType string `json:"content_type" yaml:"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" yaml:"rate_limit" db:"rate_limit"`

	BaseModel `yaml:"-"`
}

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 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" yaml:"endpoint_id"`
	SourceId   *string             `json:"source_id" db:"source_id" yaml:"source_id"`
	Config     PluginConfiguration `json:"config" db:"config"`
	Metadata   Metadata            `json:"metadata" db:"metadata"`

	BaseModel `yaml:"-"`
}

func (*Plugin) Plugin added in v0.7.0

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

func (*Plugin) SchemaName added in v0.8.0

func (m *Plugin) SchemaName() string

func (*Plugin) UnmarshalJSON added in v0.4.0

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

func (*Plugin) Validate added in v0.2.0

func (m *Plugin) Validate() error

type PluginConfiguration added in v0.4.0

type PluginConfiguration json.RawMessage

func (PluginConfiguration) MarshalJSON added in v0.4.0

func (m PluginConfiguration) MarshalJSON() ([]byte, error)

func (PluginConfiguration) MarshalYAML added in v0.4.0

func (m PluginConfiguration) MarshalYAML() (interface{}, error)

func (*PluginConfiguration) UnmarshalJSON added in v0.4.0

func (m *PluginConfiguration) UnmarshalJSON(data []byte) 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"`
	Path      string          `json:"path" db:"path"`
	Methods   Strings         `json:"methods" db:"methods"`
	Async     bool            `json:"async" db:"async"`
	Response  *CustomResponse `json:"response" db:"response"`
	Metadata  Metadata        `json:"metadata" db:"metadata"`
	RateLimit *RateLimit      `json:"rate_limit" yaml:"rate_limit" db:"rate_limit"`

	BaseModel `yaml:"-"`
}

func (*Source) SchemaName added in v0.8.0

func (m *Source) SchemaName() string

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