postgres

package
v0.9.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: MPL-2.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAPIKeyNotCreated = errors.New("api key could not be created")
	ErrAPIKeyNotUpdated = errors.New("api key could not be updated")
	ErrAPIKeyNotRevoked = errors.New("api key could not be revoked")
)
View Source
var (
	ErrDeviceNotCreated = errors.New("device could not be created")
	ErrDeviceNotFound   = errors.New("device not found")
	ErrDeviceNotUpdated = errors.New("device could not be updated")
	ErrDeviceNotDeleted = errors.New("device could not be deleted")
)
View Source
var (
	ErrEndpointNotCreated       = errors.New("endpoint could not be created")
	ErrEndpointNotUpdated       = errors.New("endpoint could not be updated")
	ErrEndpointSecretNotDeleted = errors.New("endpoint secret could not be deleted")
)
View Source
var (
	ErrEventDeliveryNotCreated         = errors.New("event delivery could not be created")
	ErrEventDeliveryStatusNotUpdated   = errors.New("event delivery status could not be updated")
	ErrEventDeliveryAttemptsNotUpdated = errors.New("event delivery attempts could not be updated")
	ErrEventDeliveriesNotDeleted       = errors.New("event deliveries could not be deleted")
)
View Source
var (
	ErrOrganizationNotCreated = errors.New("organization could not be created")
	ErrOrganizationNotUpdated = errors.New("organization could not be updated")
	ErrOrganizationNotDeleted = errors.New("organization could not be deleted")
)
View Source
var (
	ErrOrganizationInviteNotCreated = errors.New("organization invite could not be created")
	ErrOrganizationInviteNotUpdated = errors.New("organization invite could not be updated")
	ErrOrganizationInviteNotDeleted = errors.New("organization invite could not be deleted")
)
View Source
var (
	ErrOrganizationMemberNotCreated = errors.New("organization member could not be created")
	ErrOrganizationMemberNotUpdated = errors.New("organization member could not be updated")
	ErrOrganizationMemberNotDeleted = errors.New("organization member could not be deleted")
)
View Source
var (
	ErrPortalLinkNotCreated = errors.New("portal link could not be created")
	ErrPortalLinkNotUpdated = errors.New("portal link could not be updated")
	ErrPortalLinkNotDeleted = errors.New("portal link could not be deleted")
)
View Source
var (
	ErrProjectConfigNotCreated = errors.New("project config could not be created")
	ErrProjectConfigNotUpdated = errors.New("project config could not be updated")
	ErrProjectNotCreated       = errors.New("project could not be created")
	ErrProjectNotUpdated       = errors.New("project could not be updated")
	ErrProjectNotDeleted       = errors.New("project could not be deleted")
)
View Source
var (
	ErrSourceNotCreated         = errors.New("source could not be created")
	ErrSourceVerifierNotCreated = errors.New("source verifier could not be created")
	ErrSourceVerifierNotUpdated = errors.New("source verifier could not be updated")
	ErrSourceNotUpdated         = errors.New("source could not be updated")
)
View Source
var (
	ErrSubscriptionNotCreated = errors.New("subscription could not be created")
	ErrSubscriptionNotUpdated = errors.New("subscription could not be updated")
	ErrSubscriptionNotDeleted = errors.New("subscription could not be deleted")
)
View Source
var (
	ErrUserNotCreated = errors.New("user could not be created")
	ErrUserNotUpdated = errors.New("user could not be updated")
)
View Source
var ErrEventNotCreated = errors.New("event could not be created")

Functions

Types

type ApiKeyPaginated

type ApiKeyPaginated struct {
	Count int `db:"count"`
	datastore.APIKey
}

type CLIMetadata

type CLIMetadata struct {
	HostName null.String `json:"host_name" db:"host_name"`
}

func (*CLIMetadata) Scan

func (m *CLIMetadata) Scan(value interface{}) error

type DevicePaginated

type DevicePaginated struct {
	Count int
	datastore.Device
}

type Endpoint

type Endpoint struct {
	UID          null.String `db:"id"`
	Title        null.String `db:"title"`
	ProjectID    null.String `db:"project_id"`
	SupportEmail null.String `db:"support_email"`
	TargetUrl    null.String `db:"target_url"`
}

type EndpointMetadata

type EndpointMetadata struct {
	UID          null.String `db:"id"`
	Title        null.String `db:"title"`
	TargetURL    null.String `db:"target_url"`
	ProjectID    null.String `db:"project_id"`
	SupportEmail null.String `db:"support_email"`
}

type EndpointPaginated

type EndpointPaginated struct {
	EndpointSecret
}

type EndpointSecret

type EndpointSecret struct {
	Endpoint datastore.Endpoint `json:"endpoint"`
	Secret   datastore.Secret   `db:"secret"`
}

type EventDeliveryPaginated

type EventDeliveryPaginated struct {
	UID            string                `json:"uid" db:"id"`
	ProjectID      string                `json:"project_id,omitempty" db:"project_id"`
	EventID        string                `json:"event_id,omitempty" db:"event_id"`
	EndpointID     string                `json:"endpoint_id,omitempty" db:"endpoint_id"`
	DeviceID       string                `json:"device_id" db:"device_id"`
	SubscriptionID string                `json:"subscription_id,omitempty" db:"subscription_id"`
	Headers        httpheader.HTTPHeader `json:"headers" db:"headers"`

	Endpoint *EndpointMetadata `json:"endpoint_metadata,omitempty" db:"endpoint_metadata"`
	Event    *EventMetadata    `json:"event_metadata,omitempty" db:"event_metadata"`

	DeliveryAttempts datastore.DeliveryAttempts    `json:"-" db:"attempts"`
	Status           datastore.EventDeliveryStatus `json:"status" db:"status"`
	Metadata         *datastore.Metadata           `json:"metadata" db:"metadata"`
	CLIMetadata      *CLIMetadata                  `json:"cli_metadata" db:"cli_metadata"`
	Description      string                        `json:"description,omitempty" db:"description"`
	CreatedAt        time.Time                     `json:"created_at,omitempty" db:"created_at,omitempty" swaggertype:"string"`
	UpdatedAt        time.Time                     `json:"updated_at,omitempty" db:"updated_at,omitempty" swaggertype:"string"`
	DeletedAt        null.Time                     `json:"deleted_at,omitempty" db:"deleted_at" swaggertype:"string"`
}

type EventEndpoint

type EventEndpoint struct {
	EventID    string `db:"event_id"`
	EndpointID string `db:"endpoint_id"`
}

type EventMetadata

type EventMetadata struct {
	UID       null.String ` db:"id"`
	EventType null.String `db:"event_type"`
}

type EventPaginated

type EventPaginated struct {
	Count     int                   `db:"count"`
	UID       string                `db:"id"`
	EventType string                `db:"event_type"`
	SourceID  null.String           `db:"source_id"`
	AppID     string                `db:"app_id"`
	ProjectID string                `db:"project_id"`
	Headers   httpheader.HTTPHeader `db:"headers"`
	Data      json.RawMessage       `db:"data"`
	Raw       string                `db:"raw"`
	CreatedAt time.Time             `db:"created_at"`
	UpdatedAt time.Time             `db:"updated_at"`
	DeletedAt null.Time             `db:"deleted_at"`
	Endpoint  *Endpoint             `db:"endpoint"`
	Source    *Source               `db:"source"`
}

type PortalLinkEndpoint

type PortalLinkEndpoint struct {
	PortalLinkID string `db:"portal_link_id"`
	EndpointID   string `db:"endpoint_id"`
}

type PortalLinkPaginated

type PortalLinkPaginated struct {
	Count    int `db:"count"`
	Endpoint struct {
		UID          string `db:"id"`
		Title        string `db:"title"`
		ProjectID    string `db:"project_id"`
		SupportEmail string `db:"support_email"`
		TargetUrl    string `db:"target_url"`
	} `db:"endpoint"`
	datastore.PortalLink
}

type Postgres

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

func NewDB

func NewDB(cfg config.Configuration) (*Postgres, error)

func (*Postgres) GetDB

func (p *Postgres) GetDB() *sqlx.DB

type Source

type Source struct {
	UID  null.String `db:"id"`
	Name null.String `db:"name"`
}

Jump to

Keyboard shortcuts

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