postgres

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: MPL-2.0 Imports: 28 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")
	ErrEndpointExists           = errors.New("an endpoint with that name already exists")
)
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 (
	ErrJobNotFound   = errors.New("job not found")
	ErrJobNotCreated = errors.New("job could not be created")
	ErrJobNotUpdated = errors.New("job could not be updated")
	ErrJobNotDeleted = errors.New("job could not be deleted")
)
View Source
var (
	ErrMetaEventNotCreated = errors.New("meta event could not be created")
	ErrMetaEventNotUpdated = errors.New("meta event could not be updated")
)
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")
)
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 ErrPendingMigrationsFound = errors.New("migrate: Pending migrations exist, please run convoy migrate first")

ErrPendingMigrationsFound is used to indicate there exist pending migrations yet to be run if the user proceeds without running migrations it can lead to data integrity issues.

Functions

func NewJobRepo added in v1.1.6

func NewMetaEventRepo added in v1.1.6

func NewMetaEventRepo(db database.Database) datastore.MetaEventRepository

Types

type ApiKeyPaginated

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

type CLIMetadata

type CLIMetadata struct {
	EventType null.String `json:"event_type" db:"event_type"`
	SourceID  null.String `json:"source_id" db:"source_id"`
}

func (*CLIMetadata) Scan

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

type DeviceMetadata

type DeviceMetadata struct {
	UID      null.String `db:"id"`
	Status   null.String `json:"status" db:"status"`
	HostName null.String `json:"host_name" db:"host_name"`
}

type DevicePaginated

type DevicePaginated struct {
	Count int
	datastore.Device
}

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"`
	URLQueryParams string                `json:"url_query_params" db:"url_query_params"`
	IdempotencyKey string                `json:"idempotency_key" db:"idempotency_key"`

	Endpoint *EndpointMetadata `json:"endpoint_metadata,omitempty" db:"endpoint_metadata"`
	Event    *EventMetadata    `json:"event_metadata,omitempty" db:"event_metadata"`
	Source   *SourceMetadata   `json:"source_metadata,omitempty" db:"source_metadata"`
	Device   *DeviceMetadata   `json:"device_metadata,omitempty" db:"device_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 JobPaginated added in v1.1.6

type JobPaginated struct {
	Count int
	datastore.Job
}

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) Close

func (p *Postgres) Close() error

func (*Postgres) GetDB

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

func (*Postgres) GetHook added in v1.1.6

func (p *Postgres) GetHook() *hooks.Hook

type SourceMetadata

type SourceMetadata struct {
	UID             null.String    `db:"id"`
	Name            null.String    `db:"name"`
	IdempotencyKeys pq.StringArray `db:"idempotency_keys"`
}

Jump to

Keyboard shortcuts

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