database

package
v0.0.0-...-b87af0c Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiKey

type ApiKey struct {
	Id        string       `db:"id"`
	TenantId  string       `db:"tenant_id"`
	ProjectId string       `db:"project_id"`
	ApiKey    string       `db:"api_key"`
	RotatedAt sql.NullTime `db:"rotated_at"`
	ExpiresAt sql.NullTime `db:"expires_at"`
	CreatedAt time.Time    `db:"created_at"`
	UpdatedAt time.Time    `db:"updated_at"`
}

type AuditLog

type AuditLog struct {
	Id        string         `db:"id"`
	TenantId  sql.NullString `db:"tenant_id"`
	Name      string         `db:"name"`
	Data      []byte         `db:"data"`
	CreatedAt time.Time      `db:"created_at"`
}

type Database

type Database struct {
	// contains filtered or unexported fields
}

func NewDatabase

func NewDatabase(databaseConfig config.DatabaseConfig) *Database

func (*Database) WithTxn

func (db *Database) WithTxn(ctx context.Context, txOptions pgx.TxOptions, fn func(tx pgx.Tx, ctx context.Context) error) error

type DeletedRecord

type DeletedRecord struct {
	Id        string         `db:"id"`
	TenantId  sql.NullString `db:"tenant_id"`
	TableName string         `db:"table_name"`
	RecordId  string         `db:"record_id"`
	Data      []byte         `db:"data"`
	DeletedAt time.Time      `db:"deleted_at"`
}

type Endpoint

type Endpoint struct {
	Id                    string         `db:"id"`
	TenantId              string         `db:"tenant_id"`
	ProjectId             string         `db:"project_id"`
	Name                  string         `db:"name"`
	Description           sql.NullString `db:"description"`
	Url                   string         `db:"url"`
	RateLimitCount        int            `db:"rate_limit_count"`
	RateLimitDuration     int            `db:"rate_limit_duration"`
	RetryStrategy         string         `db:"retry_strategy"`
	RetryCount            int            `db:"retry_count"`
	RetryDuration         int            `db:"retry_duration"`
	AuthenticationType    string         `db:"authentication_type"`
	AuthenticationSecrets []byte         `db:"authentication_secrets"`
	Status                string         `db:"status"`
	CreatedAt             time.Time      `db:"created_at"`
	UpdatedAt             time.Time      `db:"updated_at"`
}

type Event

type Event struct {
	Id             string         `db:"id"`
	TenantId       string         `db:"tenant_id"`
	StreamId       string         `db:"stream_id"`
	Data           []byte         `db:"data"`
	IdempotencyKey sql.NullString `db:"idempotency_key"`
	CustomHeaders  []byte         `db:"custom_headers"`
	ScheduledAt    *time.Time     `db:"scheduled_at"`
	CreatedAt      time.Time      `db:"created_at"`
}

type EventDelivery

type EventDelivery struct {
	Id             string    `db:"id"`
	TenantId       string    `db:"tenant_id"`
	EventId        string    `db:"event_id"`
	EndpointId     string    `db:"endpoint_id"`
	SubscriptionId string    `db:"subscription_id"`
	AttemptedAt    time.Time `db:"attempted_at"`
	Url            string    `db:"url"`
	StatusCode     int       `db:"status_code"`
	Status         string    `db:"status"`
	CreatedAt      time.Time `db:"created_at"`
}

type Organization

type Organization struct {
	Id        string    `db:"id"`
	TenantId  string    `db:"tenant_id"`
	OwnerId   string    `db:"owner_id"`
	Name      string    `db:"name"`
	SubDomain string    `db:"sub_domain"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

type Project

type Project struct {
	Id                 string         `db:"id"`
	TenantId           string         `db:"tenant_id"`
	OrganizationId     string         `db:"organization_id"`
	Name               string         `db:"name"`
	Description        sql.NullString `db:"description"`
	DisableEndpoints   bool           `db:"disable_endpoints"`
	RetentionPolicy    string         `db:"retention_policy"`
	AllowedPayloadSize int            `db:"allowed_payload_size"`
	RateLimitCount     int            `db:"rate_limit_count"`
	RateLimitDuration  int            `db:"rate_limit_duration"`
	RetryStrategy      string         `db:"retry_strategy"`
	RetryCount         int            `db:"retry_count"`
	RetryDuration      int            `db:"retry_duration"`
	Status             string         `db:"status"`
	CreatedAt          time.Time      `db:"created_at"`
	UpdatedAt          time.Time      `db:"updated_at"`
}

type Stream

type Stream struct {
	Id             string         `db:"id"`
	TenantId       string         `db:"tenant_id"`
	ProjectId      string         `db:"project_id"`
	EventType      string         `db:"event_type"`
	Description    sql.NullString `db:"description"`
	Schema         []byte         `db:"schema"`
	ForwardHeaders []byte         `db:"forward_headers"`
	SourceType     string         `db:"source_type"`
	SourceConfig   []byte         `db:"source_config"`
	Status         string         `db:"status"`
	CreatedAt      time.Time      `db:"created_at"`
	UpdatedAt      time.Time      `db:"updated_at"`
}

type Subscription

type Subscription struct {
	Id                string    `db:"id"`
	TenantId          string    `db:"tenant_id"`
	StreamId          string    `db:"stream_id"`
	EndpointId        string    `db:"endpoint_id"`
	RateLimitCount    int       `db:"rate_limit_count"`
	RateLimitDuration int       `db:"rate_limit_duration"`
	RetryStrategy     string    `db:"retry_strategy"`
	RetryCount        int       `db:"retry_count"`
	RetryDuration     int       `db:"retry_duration"`
	Status            string    `db:"status"`
	CreatedAt         time.Time `db:"created_at"`
	UpdatedAt         time.Time `db:"updated_at"`
}

type Tenant

type Tenant struct {
	Id        string    `db:"id"`
	Name      string    `db:"name"`
	Domain    string    `db:"domain"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

type TenantOwner

type TenantOwner struct {
	Id        string    `db:"id"`
	TenantId  string    `db:"tenant_id"`
	UserId    string    `db:"user_id"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

type User

type User struct {
	Id           string    `db:"id"`
	Name         string    `db:"name"`
	Email        string    `db:"email"`
	PasswordHash string    `db:"password_hash"`
	CreatedAt    time.Time `db:"created_at"`
	UpdatedAt    time.Time `db:"updated_at"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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