db

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddSigningSecretParams

type AddSigningSecretParams struct {
	TenantID      uuid.UUID
	DestinationID uuid.UUID
	Reference     string
}

type AttemptTotalsRow

type AttemptTotalsRow struct {
	Slug  string
	Total int64
}

type AuthMethod

type AuthMethod struct {
	Name        string
	Description string
}

type ClaimDeliveriesParams

type ClaimDeliveriesParams struct {
	LeaseSeconds float64
	BatchSize    int32
}

type ClaimDeliveriesRow

type ClaimDeliveriesRow struct {
	ID            uuid.UUID
	EventID       uuid.UUID
	DestinationID uuid.UUID
	Attempts      int32
	ReplayCount   int32
}

type ClaimPlacement

type ClaimPlacement struct {
	Method    string
	Value     string
	TenantID  uuid.UUID
	RoleID    pgtype.UUID
	CreatedAt time.Time
}

type ClaimUnplannedEventsRow

type ClaimUnplannedEventsRow struct {
	ID         uuid.UUID
	TenantID   uuid.UUID
	Provider   string
	Signature  string
	Overridden bool
}

type CreateDeliveryParams

type CreateDeliveryParams struct {
	TenantID      uuid.UUID
	EventID       uuid.UUID
	DestinationID uuid.UUID
}

type CreateDestinationParams

type CreateDestinationParams struct {
	TenantID  uuid.UUID
	Name      string
	Url       string
	Transport string
}

type CreateInboundEventParams

type CreateInboundEventParams struct {
	TenantID   uuid.UUID
	Provider   string
	Path       string
	ReceivedAt time.Time
	BodySize   int32
	Signature  string
}

type CreateInboundRequestParams

type CreateInboundRequestParams struct {
	EventID  uuid.UUID
	TenantID uuid.UUID
	Headers  []byte
	Body     []byte
}

type CreatePanelSessionParams

type CreatePanelSessionParams struct {
	Token     []byte
	UserID    uuid.UUID
	ExpiresAt time.Time
}

type CreatePanelUserParams

type CreatePanelUserParams struct {
	Email        string
	PasswordHash pgtype.Text
}

type CreateRouteParams

type CreateRouteParams struct {
	TenantID      uuid.UUID
	Provider      string
	DestinationID uuid.UUID
}

type CreateSSOUserParams

type CreateSSOUserParams struct {
	Email       string
	OidcSubject pgtype.Text
}

type CreateSystemAdminParams

type CreateSystemAdminParams struct {
	Email        string
	PasswordHash pgtype.Text
}

type CreateTenantParams

type CreateTenantParams struct {
	Slug string
	Name string
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type DeletePanelUserParams

type DeletePanelUserParams struct {
	UserID   uuid.UUID
	TenantID uuid.UUID
}

type DeleteProviderParams

type DeleteProviderParams struct {
	TenantID uuid.UUID
	Name     string
}

type DeleteRoleParams

type DeleteRoleParams struct {
	TenantID pgtype.UUID
	Name     string
}

type DeleteRouteParams

type DeleteRouteParams struct {
	ID       uuid.UUID
	TenantID uuid.UUID
}

type Delivery

type Delivery struct {
	ID            uuid.UUID
	EventID       uuid.UUID
	DestinationID uuid.UUID
	State         string
	Attempts      int32
	NextAttemptAt time.Time
	LeasedUntil   pgtype.Timestamptz
	LastStatus    pgtype.Int4
	LastError     pgtype.Text
	DeliveredAt   pgtype.Timestamptz
	CreatedAt     time.Time
	ReplayCount   int32
	ReplayedAt    pgtype.Timestamptz
	TenantID      uuid.UUID
}

type DeliveryAttempt

type DeliveryAttempt struct {
	ID                uuid.UUID
	DeliveryID        uuid.UUID
	Attempt           int32
	AttemptedAt       time.Time
	Status            pgtype.Int4
	Error             pgtype.Text
	DurationMs        int32
	Round             int32
	TenantID          uuid.UUID
	SignedWith        string
	Forced            bool
	Response          []byte
	ResponseType      string
	ResponseTruncated bool
}

type DeliveryAttemptsParams

type DeliveryAttemptsParams struct {
	DeliveryID uuid.UUID
	TenantID   uuid.UUID
}

type DeliveryAttemptsRow

type DeliveryAttemptsRow struct {
	Round             int32
	Attempt           int32
	AttemptedAt       time.Time
	Status            pgtype.Int4
	Error             pgtype.Text
	DurationMs        int32
	SignedWith        string
	Forced            bool
	Response          []byte
	ResponseType      string
	ResponseTruncated bool
}

type DeliveryState

type DeliveryState struct {
	Name        string
	Description string
}

type DeliveryStateTotalsRow

type DeliveryStateTotalsRow struct {
	State string
	Total int64
}

type DeliveryTargetRow

type DeliveryTargetRow struct {
	Url       string
	Transport string
	Provider  string
	Path      string
	Headers   []byte
	Body      []byte
}

type DeliveryTotalsRow

type DeliveryTotalsRow struct {
	Slug  string
	State string
	Total int64
}

type Destination

type Destination struct {
	ID        uuid.UUID
	Name      string
	Url       string
	Enabled   bool
	CreatedAt time.Time
	Transport string
	TenantID  uuid.UUID
}

type DestinationByNameParams

type DestinationByNameParams struct {
	TenantID uuid.UUID
	Name     string
}

type DestinationsWithoutSigningRow

type DestinationsWithoutSigningRow struct {
	ID     uuid.UUID
	Name   string
	Routes int64
}

type DetailedRoutesRow

type DetailedRoutesRow struct {
	ID            uuid.UUID
	Provider      string
	DestinationID uuid.UUID
	Name          string
	Url           string
	Transport     string
	Enabled       bool
	Deliveries    int64
}

type EnabledDestinationsForProviderParams

type EnabledDestinationsForProviderParams struct {
	TenantID uuid.UUID
	Provider string
}

type EventDeliveriesParams

type EventDeliveriesParams struct {
	EventID  uuid.UUID
	TenantID uuid.UUID
}

type EventDeliveriesRow

type EventDeliveriesRow struct {
	ID            uuid.UUID
	Destination   string
	Url           string
	State         string
	Attempts      int32
	NextAttemptAt time.Time
	LastStatus    pgtype.Int4
	LastError     pgtype.Text
	DeliveredAt   pgtype.Timestamptz
	ReplayCount   int32
	ReplayedAt    pgtype.Timestamptz
	Routed        bool
}

type EventDetailParams

type EventDetailParams struct {
	ID       uuid.UUID
	TenantID uuid.UUID
}

type EventDetailRow

type EventDetailRow struct {
	ID         uuid.UUID
	Provider   string
	Path       string
	ReceivedAt time.Time
	BodySize   int32
	PlannedAt  pgtype.Timestamptz
	Signature  string
	Headers    []byte
	Body       []byte
}

type EventTotalsRow

type EventTotalsRow struct {
	Slug      string
	Signature string
	Total     int64
}

type ForgetShippedGrantsParams

type ForgetShippedGrantsParams struct {
	RoleID uuid.UUID
	Keep   []string
}

type GetInboundEventParams

type GetInboundEventParams struct {
	ID       uuid.UUID
	TenantID uuid.UUID
}

type GetInboundRequestParams

type GetInboundRequestParams struct {
	EventID  uuid.UUID
	TenantID uuid.UUID
}

type GrantPermissionParams

type GrantPermissionParams struct {
	RoleID uuid.UUID
	Name   string
}

type InboundEvent

type InboundEvent struct {
	ID         uuid.UUID
	Provider   string
	Path       string
	ReceivedAt time.Time
	BodySize   int32
	PlannedAt  pgtype.Timestamptz
	Signature  string
	TenantID   uuid.UUID
	OverrideID pgtype.UUID
}

type InboundRequest

type InboundRequest struct {
	EventID  uuid.UUID
	Headers  []byte
	Body     []byte
	TenantID uuid.UUID
}

type JoinFromProviderAsParams

type JoinFromProviderAsParams struct {
	UserID   uuid.UUID
	TenantID uuid.UUID
	RoleID   pgtype.UUID
}

type JoinFromProviderParams

type JoinFromProviderParams struct {
	UserID   uuid.UUID
	TenantID uuid.UUID
}

type JoinTenantParams

type JoinTenantParams struct {
	UserID   uuid.UUID
	TenantID uuid.UUID
	RoleID   pgtype.UUID
}

type LeaveTenantsNoLongerNamedParams

type LeaveTenantsNoLongerNamedParams struct {
	UserID  uuid.UUID
	Column2 []uuid.UUID
}

type LinkSubjectToUserParams

type LinkSubjectToUserParams struct {
	Email       string
	OidcSubject pgtype.Text
}

type ListRoutesRow

type ListRoutesRow struct {
	Provider  string
	Name      string
	Url       string
	Transport string
	Enabled   bool
	Signed    int64
}

type MarkDeliveredParams

type MarkDeliveredParams struct {
	ID         uuid.UUID
	LastStatus pgtype.Int4
}

type MarkFailedParams

type MarkFailedParams struct {
	ID            uuid.UUID
	NextAttemptAt time.Time
	LastStatus    pgtype.Int4
	LastError     pgtype.Text
	MaxAttempts   int32
}

type MarkSignatureAndReopenParams

type MarkSignatureAndReopenParams struct {
	ID        uuid.UUID
	Signature string
}

type MarkSignatureParams

type MarkSignatureParams struct {
	ID        uuid.UUID
	Signature string
}

type Membership

type Membership struct {
	UserID    uuid.UUID
	TenantID  uuid.UUID
	RoleID    pgtype.UUID
	CreatedAt time.Time
}

type MembershipInParams

type MembershipInParams struct {
	UserID   uuid.UUID
	TenantID uuid.UUID
}

type MembershipsRow

type MembershipsRow struct {
	TenantID   uuid.UUID
	Slug       string
	TenantName string
	Role       string
	CreatedAt  time.Time
}

type NextWorkAtRow

type NextWorkAtRow struct {
	At    time.Time
	Found bool
}

type OldestPendingRow

type OldestPendingRow struct {
	Slug    string
	Seconds float64
}

type OverrideEventsParams

type OverrideEventsParams struct {
	OverrideID pgtype.UUID
	TenantID   uuid.UUID
	Ids        []uuid.UUID
}

type OverruleOnEventParams

type OverruleOnEventParams struct {
	ID       uuid.UUID
	TenantID uuid.UUID
}

type OverruleOnEventRow

type OverruleOnEventRow struct {
	Reason    string
	DecidedAt time.Time
	DecidedBy string
}

type PanelSession

type PanelSession struct {
	Token     []byte
	UserID    uuid.UUID
	CreatedAt time.Time
	ExpiresAt time.Time
}

type PanelSessionUserRow

type PanelSessionUserRow struct {
	ID          uuid.UUID
	Email       string
	SystemAdmin bool
	TimeZone    string
}

type PanelUser

type PanelUser struct {
	ID           uuid.UUID
	Email        string
	PasswordHash pgtype.Text
	CreatedAt    time.Time
	OidcSubject  pgtype.Text
	SystemAdmin  bool
	TimeZone     string
}

type PanelUsersRow

type PanelUsersRow struct {
	ID          uuid.UUID
	Email       string
	Role        pgtype.Text
	OidcSubject pgtype.Text
	CreatedAt   time.Time
}

type Permission

type Permission struct {
	ID          uuid.UUID
	Name        string
	Description string
}

type PermissionsRow

type PermissionsRow struct {
	Name        string
	Description string
}

type PlacementsPointedAtParams

type PlacementsPointedAtParams struct {
	Method  string
	Column2 []string
}

type PlacementsPointedAtRow

type PlacementsPointedAtRow struct {
	Value    string
	TenantID uuid.UUID
	Role     string
}

type PointValueAtParams

type PointValueAtParams struct {
	Method   string
	Value    string
	TenantID uuid.UUID
	RoleID   pgtype.UUID
}

type Provider

type Provider struct {
	Name             string
	Verifier         string
	SecretEnv        string
	SignatureHeader  pgtype.Text
	ToleranceSeconds int32
	CreatedAt        time.Time
	Scheme           string
	Algorithm        string
	Encoding         string
	TimestampKey     string
	SignatureKey     string
	TenantID         uuid.UUID
	VerifyTokenEnv   string
}

type ProviderAlreadyRoutedToParams

type ProviderAlreadyRoutedToParams struct {
	TenantID uuid.UUID
	Provider string
	Url      string
}

type ProvidersRow

type ProvidersRow struct {
	Name             string
	Verifier         string
	SecretEnv        string
	SignatureHeader  pgtype.Text
	ToleranceSeconds int32
	Scheme           string
	Algorithm        string
	Encoding         string
	TimestampKey     string
	SignatureKey     string
	VerifyTokenEnv   string
}

type PurgeEventsParams

type PurgeEventsParams struct {
	TenantID uuid.UUID
	Days     int32
}

type PurgeableEventsParams

type PurgeableEventsParams struct {
	TenantID uuid.UUID
	Days     int32
}

type Querier

type Querier interface {
	AddSigningSecret(ctx context.Context, arg AddSigningSecretParams) error
	AttemptTotals(ctx context.Context, tenantID uuid.UUID) ([]AttemptTotalsRow, error)
	// Switching a destination off pauses it. What is already waiting for it stays
	// waiting, keeping its attempts, instead of being spent against somewhere that
	// was deliberately taken out of service — which would leave a delivery dead by
	// the time it came back.
	ClaimDeliveries(ctx context.Context, arg ClaimDeliveriesParams) ([]ClaimDeliveriesRow, error)
	// A signature that was checked and failed is never delivered, unless somebody
	// overruled that deliberately and said why. One that was never checked is
	// delivered: a provider with no verifier configured behaves as before.
	ClaimUnplannedEvents(ctx context.Context, limit int32) ([]ClaimUnplannedEventsRow, error)
	ClearRoleGrants(ctx context.Context, roleID uuid.UUID) error
	ClearSystemAdmin(ctx context.Context, id uuid.UUID) (int64, error)
	ClearSystemAdminByEmail(ctx context.Context, email string) (int64, error)
	CountEventsAwaitingRoute(ctx context.Context, tenantID uuid.UUID) (int64, error)
	CountInboundEvents(ctx context.Context) (int64, error)
	CountOperators(ctx context.Context) (int64, error)
	CountPanelUsers(ctx context.Context) (int64, error)
	CountSystemAdmins(ctx context.Context) (int64, error)
	CountTenants(ctx context.Context) (int64, error)
	CreateDelivery(ctx context.Context, arg CreateDeliveryParams) error
	CreateDestination(ctx context.Context, arg CreateDestinationParams) (Destination, error)
	CreateInboundEvent(ctx context.Context, arg CreateInboundEventParams) (uuid.UUID, error)
	CreateInboundRequest(ctx context.Context, arg CreateInboundRequestParams) error
	CreatePanelSession(ctx context.Context, arg CreatePanelSessionParams) error
	CreatePanelUser(ctx context.Context, arg CreatePanelUserParams) (uuid.UUID, error)
	CreateRoute(ctx context.Context, arg CreateRouteParams) error
	CreateSSOUser(ctx context.Context, arg CreateSSOUserParams) (PanelUser, error)
	CreateSystemAdmin(ctx context.Context, arg CreateSystemAdminParams) error
	CreateTenant(ctx context.Context, arg CreateTenantParams) (Tenant, error)
	DeleteExpiredPanelSessions(ctx context.Context) error
	DeletePanelSession(ctx context.Context, token []byte) error
	DeletePanelUser(ctx context.Context, arg DeletePanelUserParams) (int64, error)
	DeleteProvider(ctx context.Context, arg DeleteProviderParams) error
	DeleteRole(ctx context.Context, arg DeleteRoleParams) (int64, error)
	DeleteRoute(ctx context.Context, arg DeleteRouteParams) error
	DeleteTenant(ctx context.Context, slug string) error
	DeliveryAttempts(ctx context.Context, arg DeliveryAttemptsParams) ([]DeliveryAttemptsRow, error)
	DeliveryStateTotals(ctx context.Context, tenantID uuid.UUID) ([]DeliveryStateTotalsRow, error)
	DeliveryTarget(ctx context.Context, id uuid.UUID) (DeliveryTargetRow, error)
	DeliveryTotals(ctx context.Context, tenantID uuid.UUID) ([]DeliveryTotalsRow, error)
	DestinationByName(ctx context.Context, arg DestinationByNameParams) (Destination, error)
	DestinationsWithoutSigning(ctx context.Context, tenantID uuid.UUID) ([]DestinationsWithoutSigningRow, error)
	DetailedRoutes(ctx context.Context, tenantID uuid.UUID) ([]DetailedRoutesRow, error)
	DistinctProviders(ctx context.Context, tenantID uuid.UUID) ([]string, error)
	EnabledDestinationsForProvider(ctx context.Context, arg EnabledDestinationsForProviderParams) ([]uuid.UUID, error)
	EventDeliveries(ctx context.Context, arg EventDeliveriesParams) ([]EventDeliveriesRow, error)
	EventDetail(ctx context.Context, arg EventDetailParams) (EventDetailRow, error)
	// Every number a scrape reports, one tenant at a time. A scrape covers the
	// whole deployment, but each query still names the tenant it counts: the
	// tenant is pinned on the connection, not on the statement, so a query that
	// left it out would count whatever the pooled connection happened to be
	// pinned to and report it under every tenant's name.
	EventTotals(ctx context.Context, tenantID uuid.UUID) ([]EventTotalsRow, error)
	EventsUnderOverride(ctx context.Context, overrideID pgtype.UUID) ([]uuid.UUID, error)
	// A role nobody has changed grants what this build says it grants: not only
	// what is missing, but exactly that, so a permission the build stopped
	// shipping stops being granted too.
	ForgetShippedGrants(ctx context.Context, arg ForgetShippedGrantsParams) error
	GetInboundEvent(ctx context.Context, arg GetInboundEventParams) (InboundEvent, error)
	GetInboundRequest(ctx context.Context, arg GetInboundRequestParams) (InboundRequest, error)
	GrantPermission(ctx context.Context, arg GrantPermissionParams) error
	// A value that names only a tenant leaves the role to whoever decides it here,
	// so arriving again does not undo it.
	JoinFromProvider(ctx context.Context, arg JoinFromProviderParams) error
	// A value that names the role too makes the token the truth about it as well.
	JoinFromProviderAs(ctx context.Context, arg JoinFromProviderAsParams) error
	JoinTenant(ctx context.Context, arg JoinTenantParams) error
	KnownProviders(ctx context.Context, tenantID uuid.UUID) ([]string, error)
	LeaveEveryTenant(ctx context.Context, userID uuid.UUID) error
	LeaveEveryTenantByEmail(ctx context.Context, email string) error
	LeaveTenantsNoLongerNamed(ctx context.Context, arg LeaveTenantsNoLongerNamedParams) error
	LinkSubjectToUser(ctx context.Context, arg LinkSubjectToUserParams) (PanelUser, error)
	ListRecentInboundEvents(ctx context.Context, limit int32) ([]InboundEvent, error)
	ListRoutes(ctx context.Context, tenantID uuid.UUID) ([]ListRoutesRow, error)
	MarkDelivered(ctx context.Context, arg MarkDeliveredParams) error
	MarkEventPlanned(ctx context.Context, id uuid.UUID) error
	MarkFailed(ctx context.Context, arg MarkFailedParams) error
	MarkSignature(ctx context.Context, arg MarkSignatureParams) error
	MarkSignatureAndReopen(ctx context.Context, arg MarkSignatureAndReopenParams) error
	MembershipIn(ctx context.Context, arg MembershipInParams) (string, error)
	Memberships(ctx context.Context, userID uuid.UUID) ([]MembershipsRow, error)
	NextWorkAt(ctx context.Context) (NextWorkAtRow, error)
	NotifyPanel(ctx context.Context) error
	NotifyProviders(ctx context.Context) error
	NotifySigning(ctx context.Context) error
	NotifyTenants(ctx context.Context) error
	NotifyWork(ctx context.Context) error
	OldestPending(ctx context.Context, tenantID uuid.UUID) ([]OldestPendingRow, error)
	OldestPendingAge(ctx context.Context) (float64, error)
	// An event is overruled once. Saying so twice is the same decision, not a new
	// one, and the first is the one that let it out.
	OverrideEvents(ctx context.Context, arg OverrideEventsParams) (int64, error)
	OverruleOnEvent(ctx context.Context, arg OverruleOnEventParams) (OverruleOnEventRow, error)
	PanelSessionUser(ctx context.Context, token []byte) (PanelSessionUserRow, error)
	PanelUserByEmail(ctx context.Context, email string) (PanelUser, error)
	PanelUserBySubject(ctx context.Context, oidcSubject pgtype.Text) (PanelUser, error)
	PanelUsers(ctx context.Context, tenantID uuid.UUID) ([]PanelUsersRow, error)
	Permissions(ctx context.Context) ([]PermissionsRow, error)
	PlacementsPointedAt(ctx context.Context, arg PlacementsPointedAtParams) ([]PlacementsPointedAtRow, error)
	PointValueAt(ctx context.Context, arg PointValueAtParams) error
	ProviderAlreadyRoutedTo(ctx context.Context, arg ProviderAlreadyRoutedToParams) (bool, error)
	Providers(ctx context.Context, tenantID uuid.UUID) ([]ProvidersRow, error)
	// An event is only discarded once nothing is still trying to deliver it. A
	// pending delivery is live work, and its age says the destination has been
	// unreachable for a long time, which is a reason to look rather than to erase.
	PurgeEvents(ctx context.Context, arg PurgeEventsParams) (int64, error)
	PurgeableEvents(ctx context.Context, arg PurgeableEventsParams) (int64, error)
	RecordDeliveryAttempt(ctx context.Context, arg RecordDeliveryAttemptParams) error
	RecordOverride(ctx context.Context, arg RecordOverrideParams) (uuid.UUID, error)
	RecordSigningCheck(ctx context.Context, arg RecordSigningCheckParams) error
	RefusedByProvider(ctx context.Context, tenantID uuid.UUID) ([]RefusedByProviderRow, error)
	RegisterAuthMethod(ctx context.Context, name string) error
	RegisterDeliveryState(ctx context.Context, arg RegisterDeliveryStateParams) error
	RegisterPermission(ctx context.Context, arg RegisterPermissionParams) error
	RegisterShippedGrant(ctx context.Context, arg RegisterShippedGrantParams) error
	// A role Charon ships belongs to no tenant and is held in any. Its description
	// is left alone once it exists, because a deployment is allowed to change it.
	RegisterShippedRole(ctx context.Context, arg RegisterShippedRoleParams) (uuid.UUID, error)
	RegisterSignatureState(ctx context.Context, arg RegisterSignatureStateParams) error
	RegisterTransport(ctx context.Context, name string) error
	RegisterVerifier(ctx context.Context, name string) error
	RemoveSigningSecret(ctx context.Context, arg RemoveSigningSecretParams) (int64, error)
	// A replay only reopens deliveries whose destination is still routed for this
	// event's provider and still enabled. Anything else is history: the routes page
	// is the truth about where events go.
	ReplayDelivery(ctx context.Context, arg ReplayDeliveryParams) (int64, error)
	ReplayDestination(ctx context.Context, arg ReplayDestinationParams) (int64, error)
	ReplayEvent(ctx context.Context, arg ReplayEventParams) (int64, error)
	Retentions(ctx context.Context) ([]RetentionsRow, error)
	// A tenant may define a role of its own under a name Charon also ships, and
	// changing a shipped role is how that happens. Its own wins, said here rather
	// than left to whichever row the database hands back first: deciding what
	// somebody may do cannot depend on that.
	Role(ctx context.Context, arg RoleParams) (RoleRow, error)
	RoleByID(ctx context.Context, id uuid.UUID) (RoleByIDRow, error)
	RoleIDByName(ctx context.Context, arg RoleIDByNameParams) (uuid.UUID, error)
	RoleWasChanged(ctx context.Context, id uuid.UUID) (bool, error)
	Roles(ctx context.Context, tenantID pgtype.UUID) ([]RolesRow, error)
	RouteByID(ctx context.Context, arg RouteByIDParams) (RouteByIDRow, error)
	// The state counts only take deliveries whose destination is still routed and
	// enabled, so the numbers reconcile with the routes page. What is left over is
	// reported apart as history.
	SearchEvents(ctx context.Context, arg SearchEventsParams) ([]SearchEventsRow, error)
	SetPanelUserTimeZone(ctx context.Context, arg SetPanelUserTimeZoneParams) error
	SetProvider(ctx context.Context, arg SetProviderParams) error
	SetRetention(ctx context.Context, arg SetRetentionParams) (int64, error)
	// Changing a role is what makes it the deployment's, and from then on starting
	// leaves it alone.
	SetRole(ctx context.Context, arg SetRoleParams) (uuid.UUID, error)
	// Becoming one means leaving the role behind, and with it the tenant the role
	// belonged to; giving it up means being given a role again.
	SetSystemAdmin(ctx context.Context, id uuid.UUID) (int64, error)
	SetSystemAdminByEmail(ctx context.Context, email string) (int64, error)
	SignatureTotals(ctx context.Context) ([]SignatureTotalsRow, error)
	SigningFor(ctx context.Context, destinationID uuid.UUID) ([]SigningForRow, error)
	SigningSecrets(ctx context.Context, tenantID uuid.UUID) ([]SigningSecretsRow, error)
	SigningSecretsEverywhere(ctx context.Context) ([]SigningSecretsEverywhereRow, error)
	SigningSecretsFor(ctx context.Context, destinationID uuid.UUID) ([]string, error)
	StopPointingValue(ctx context.Context, arg StopPointingValueParams) error
	SystemAdmins(ctx context.Context) ([]SystemAdminsRow, error)
	TenantBySlug(ctx context.Context, slug string) (Tenant, error)
	Tenants(ctx context.Context) ([]Tenant, error)
	TenantsNamed(ctx context.Context, dollar_1 []string) ([]TenantsNamedRow, error)
	// What failed against an address that was wrong did not fail against the
	// destination, so a corrected address gets the attempts back and is tried at
	// once rather than at the end of a backoff earned by a typo.
	TryAgainAtTheNewAddress(ctx context.Context, arg TryAgainAtTheNewAddressParams) (int64, error)
	UnplanEvent(ctx context.Context, arg UnplanEventParams) error
	UnplanProvider(ctx context.Context, arg UnplanProviderParams) (int64, error)
	UnroutedProviders(ctx context.Context, tenantID uuid.UUID) ([]UnroutedProvidersRow, error)
	UnverifiedEvents(ctx context.Context, arg UnverifiedEventsParams) ([]UnverifiedEventsRow, error)
	UpdateDestination(ctx context.Context, arg UpdateDestinationParams) error
	UpdatePanelUserRole(ctx context.Context, arg UpdatePanelUserRoleParams) (int64, error)
	ValuesPointedAtTenant(ctx context.Context, tenantID uuid.UUID) ([]ValuesPointedAtTenantRow, error)
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddSigningSecret

func (q *Queries) AddSigningSecret(ctx context.Context, arg AddSigningSecretParams) error

func (*Queries) AttemptTotals

func (q *Queries) AttemptTotals(ctx context.Context, tenantID uuid.UUID) ([]AttemptTotalsRow, error)

func (*Queries) ClaimDeliveries

func (q *Queries) ClaimDeliveries(ctx context.Context, arg ClaimDeliveriesParams) ([]ClaimDeliveriesRow, error)

Switching a destination off pauses it. What is already waiting for it stays waiting, keeping its attempts, instead of being spent against somewhere that was deliberately taken out of service — which would leave a delivery dead by the time it came back.

func (*Queries) ClaimUnplannedEvents

func (q *Queries) ClaimUnplannedEvents(ctx context.Context, limit int32) ([]ClaimUnplannedEventsRow, error)

A signature that was checked and failed is never delivered, unless somebody overruled that deliberately and said why. One that was never checked is delivered: a provider with no verifier configured behaves as before.

func (*Queries) ClearRoleGrants

func (q *Queries) ClearRoleGrants(ctx context.Context, roleID uuid.UUID) error

func (*Queries) ClearSystemAdmin

func (q *Queries) ClearSystemAdmin(ctx context.Context, id uuid.UUID) (int64, error)

func (*Queries) ClearSystemAdminByEmail

func (q *Queries) ClearSystemAdminByEmail(ctx context.Context, email string) (int64, error)

func (*Queries) CountEventsAwaitingRoute

func (q *Queries) CountEventsAwaitingRoute(ctx context.Context, tenantID uuid.UUID) (int64, error)

func (*Queries) CountInboundEvents

func (q *Queries) CountInboundEvents(ctx context.Context) (int64, error)

func (*Queries) CountOperators

func (q *Queries) CountOperators(ctx context.Context) (int64, error)

func (*Queries) CountPanelUsers

func (q *Queries) CountPanelUsers(ctx context.Context) (int64, error)

func (*Queries) CountSystemAdmins

func (q *Queries) CountSystemAdmins(ctx context.Context) (int64, error)

func (*Queries) CountTenants

func (q *Queries) CountTenants(ctx context.Context) (int64, error)

func (*Queries) CreateDelivery

func (q *Queries) CreateDelivery(ctx context.Context, arg CreateDeliveryParams) error

func (*Queries) CreateDestination

func (q *Queries) CreateDestination(ctx context.Context, arg CreateDestinationParams) (Destination, error)

func (*Queries) CreateInboundEvent

func (q *Queries) CreateInboundEvent(ctx context.Context, arg CreateInboundEventParams) (uuid.UUID, error)

func (*Queries) CreateInboundRequest

func (q *Queries) CreateInboundRequest(ctx context.Context, arg CreateInboundRequestParams) error

func (*Queries) CreatePanelSession

func (q *Queries) CreatePanelSession(ctx context.Context, arg CreatePanelSessionParams) error

func (*Queries) CreatePanelUser

func (q *Queries) CreatePanelUser(ctx context.Context, arg CreatePanelUserParams) (uuid.UUID, error)

func (*Queries) CreateRoute

func (q *Queries) CreateRoute(ctx context.Context, arg CreateRouteParams) error

func (*Queries) CreateSSOUser

func (q *Queries) CreateSSOUser(ctx context.Context, arg CreateSSOUserParams) (PanelUser, error)

func (*Queries) CreateSystemAdmin

func (q *Queries) CreateSystemAdmin(ctx context.Context, arg CreateSystemAdminParams) error

func (*Queries) CreateTenant

func (q *Queries) CreateTenant(ctx context.Context, arg CreateTenantParams) (Tenant, error)

func (*Queries) DeleteExpiredPanelSessions

func (q *Queries) DeleteExpiredPanelSessions(ctx context.Context) error

func (*Queries) DeletePanelSession

func (q *Queries) DeletePanelSession(ctx context.Context, token []byte) error

func (*Queries) DeletePanelUser

func (q *Queries) DeletePanelUser(ctx context.Context, arg DeletePanelUserParams) (int64, error)

func (*Queries) DeleteProvider

func (q *Queries) DeleteProvider(ctx context.Context, arg DeleteProviderParams) error

func (*Queries) DeleteRole

func (q *Queries) DeleteRole(ctx context.Context, arg DeleteRoleParams) (int64, error)

func (*Queries) DeleteRoute

func (q *Queries) DeleteRoute(ctx context.Context, arg DeleteRouteParams) error

func (*Queries) DeleteTenant

func (q *Queries) DeleteTenant(ctx context.Context, slug string) error

func (*Queries) DeliveryAttempts

func (q *Queries) DeliveryAttempts(ctx context.Context, arg DeliveryAttemptsParams) ([]DeliveryAttemptsRow, error)

func (*Queries) DeliveryStateTotals

func (q *Queries) DeliveryStateTotals(ctx context.Context, tenantID uuid.UUID) ([]DeliveryStateTotalsRow, error)

func (*Queries) DeliveryTarget

func (q *Queries) DeliveryTarget(ctx context.Context, id uuid.UUID) (DeliveryTargetRow, error)

func (*Queries) DeliveryTotals

func (q *Queries) DeliveryTotals(ctx context.Context, tenantID uuid.UUID) ([]DeliveryTotalsRow, error)

func (*Queries) DestinationByName

func (q *Queries) DestinationByName(ctx context.Context, arg DestinationByNameParams) (Destination, error)

func (*Queries) DestinationsWithoutSigning

func (q *Queries) DestinationsWithoutSigning(ctx context.Context, tenantID uuid.UUID) ([]DestinationsWithoutSigningRow, error)

func (*Queries) DetailedRoutes

func (q *Queries) DetailedRoutes(ctx context.Context, tenantID uuid.UUID) ([]DetailedRoutesRow, error)

func (*Queries) DistinctProviders

func (q *Queries) DistinctProviders(ctx context.Context, tenantID uuid.UUID) ([]string, error)

func (*Queries) EnabledDestinationsForProvider

func (q *Queries) EnabledDestinationsForProvider(ctx context.Context, arg EnabledDestinationsForProviderParams) ([]uuid.UUID, error)

func (*Queries) EventDeliveries

func (q *Queries) EventDeliveries(ctx context.Context, arg EventDeliveriesParams) ([]EventDeliveriesRow, error)

func (*Queries) EventDetail

func (q *Queries) EventDetail(ctx context.Context, arg EventDetailParams) (EventDetailRow, error)

func (*Queries) EventTotals

func (q *Queries) EventTotals(ctx context.Context, tenantID uuid.UUID) ([]EventTotalsRow, error)

Every number a scrape reports, one tenant at a time. A scrape covers the whole deployment, but each query still names the tenant it counts: the tenant is pinned on the connection, not on the statement, so a query that left it out would count whatever the pooled connection happened to be pinned to and report it under every tenant's name.

func (*Queries) EventsUnderOverride

func (q *Queries) EventsUnderOverride(ctx context.Context, overrideID pgtype.UUID) ([]uuid.UUID, error)

func (*Queries) ForgetShippedGrants

func (q *Queries) ForgetShippedGrants(ctx context.Context, arg ForgetShippedGrantsParams) error

A role nobody has changed grants what this build says it grants: not only what is missing, but exactly that, so a permission the build stopped shipping stops being granted too.

func (*Queries) GetInboundEvent

func (q *Queries) GetInboundEvent(ctx context.Context, arg GetInboundEventParams) (InboundEvent, error)

func (*Queries) GetInboundRequest

func (q *Queries) GetInboundRequest(ctx context.Context, arg GetInboundRequestParams) (InboundRequest, error)

func (*Queries) GrantPermission

func (q *Queries) GrantPermission(ctx context.Context, arg GrantPermissionParams) error

func (*Queries) JoinFromProvider

func (q *Queries) JoinFromProvider(ctx context.Context, arg JoinFromProviderParams) error

A value that names only a tenant leaves the role to whoever decides it here, so arriving again does not undo it.

func (*Queries) JoinFromProviderAs

func (q *Queries) JoinFromProviderAs(ctx context.Context, arg JoinFromProviderAsParams) error

A value that names the role too makes the token the truth about it as well.

func (*Queries) JoinTenant

func (q *Queries) JoinTenant(ctx context.Context, arg JoinTenantParams) error

func (*Queries) KnownProviders

func (q *Queries) KnownProviders(ctx context.Context, tenantID uuid.UUID) ([]string, error)

func (*Queries) LeaveEveryTenant

func (q *Queries) LeaveEveryTenant(ctx context.Context, userID uuid.UUID) error

func (*Queries) LeaveEveryTenantByEmail

func (q *Queries) LeaveEveryTenantByEmail(ctx context.Context, email string) error

func (*Queries) LeaveTenantsNoLongerNamed

func (q *Queries) LeaveTenantsNoLongerNamed(ctx context.Context, arg LeaveTenantsNoLongerNamedParams) error

func (*Queries) LinkSubjectToUser

func (q *Queries) LinkSubjectToUser(ctx context.Context, arg LinkSubjectToUserParams) (PanelUser, error)

func (*Queries) ListRecentInboundEvents

func (q *Queries) ListRecentInboundEvents(ctx context.Context, limit int32) ([]InboundEvent, error)

func (*Queries) ListRoutes

func (q *Queries) ListRoutes(ctx context.Context, tenantID uuid.UUID) ([]ListRoutesRow, error)

func (*Queries) MarkDelivered

func (q *Queries) MarkDelivered(ctx context.Context, arg MarkDeliveredParams) error

func (*Queries) MarkEventPlanned

func (q *Queries) MarkEventPlanned(ctx context.Context, id uuid.UUID) error

func (*Queries) MarkFailed

func (q *Queries) MarkFailed(ctx context.Context, arg MarkFailedParams) error

func (*Queries) MarkSignature

func (q *Queries) MarkSignature(ctx context.Context, arg MarkSignatureParams) error

func (*Queries) MarkSignatureAndReopen

func (q *Queries) MarkSignatureAndReopen(ctx context.Context, arg MarkSignatureAndReopenParams) error

func (*Queries) MembershipIn

func (q *Queries) MembershipIn(ctx context.Context, arg MembershipInParams) (string, error)

func (*Queries) Memberships

func (q *Queries) Memberships(ctx context.Context, userID uuid.UUID) ([]MembershipsRow, error)

func (*Queries) NextWorkAt

func (q *Queries) NextWorkAt(ctx context.Context) (NextWorkAtRow, error)

func (*Queries) NotifyPanel

func (q *Queries) NotifyPanel(ctx context.Context) error

func (*Queries) NotifyProviders

func (q *Queries) NotifyProviders(ctx context.Context) error

func (*Queries) NotifySigning

func (q *Queries) NotifySigning(ctx context.Context) error

func (*Queries) NotifyTenants

func (q *Queries) NotifyTenants(ctx context.Context) error

func (*Queries) NotifyWork

func (q *Queries) NotifyWork(ctx context.Context) error

func (*Queries) OldestPending

func (q *Queries) OldestPending(ctx context.Context, tenantID uuid.UUID) ([]OldestPendingRow, error)

func (*Queries) OldestPendingAge

func (q *Queries) OldestPendingAge(ctx context.Context) (float64, error)

func (*Queries) OverrideEvents

func (q *Queries) OverrideEvents(ctx context.Context, arg OverrideEventsParams) (int64, error)

An event is overruled once. Saying so twice is the same decision, not a new one, and the first is the one that let it out.

func (*Queries) OverruleOnEvent

func (q *Queries) OverruleOnEvent(ctx context.Context, arg OverruleOnEventParams) (OverruleOnEventRow, error)

func (*Queries) PanelSessionUser

func (q *Queries) PanelSessionUser(ctx context.Context, token []byte) (PanelSessionUserRow, error)

func (*Queries) PanelUserByEmail

func (q *Queries) PanelUserByEmail(ctx context.Context, email string) (PanelUser, error)

func (*Queries) PanelUserBySubject

func (q *Queries) PanelUserBySubject(ctx context.Context, oidcSubject pgtype.Text) (PanelUser, error)

func (*Queries) PanelUsers

func (q *Queries) PanelUsers(ctx context.Context, tenantID uuid.UUID) ([]PanelUsersRow, error)

func (*Queries) Permissions

func (q *Queries) Permissions(ctx context.Context) ([]PermissionsRow, error)

func (*Queries) PlacementsPointedAt

func (q *Queries) PlacementsPointedAt(ctx context.Context, arg PlacementsPointedAtParams) ([]PlacementsPointedAtRow, error)

func (*Queries) PointValueAt

func (q *Queries) PointValueAt(ctx context.Context, arg PointValueAtParams) error

func (*Queries) ProviderAlreadyRoutedTo

func (q *Queries) ProviderAlreadyRoutedTo(ctx context.Context, arg ProviderAlreadyRoutedToParams) (bool, error)

func (*Queries) Providers

func (q *Queries) Providers(ctx context.Context, tenantID uuid.UUID) ([]ProvidersRow, error)

func (*Queries) PurgeEvents

func (q *Queries) PurgeEvents(ctx context.Context, arg PurgeEventsParams) (int64, error)

An event is only discarded once nothing is still trying to deliver it. A pending delivery is live work, and its age says the destination has been unreachable for a long time, which is a reason to look rather than to erase.

func (*Queries) PurgeableEvents

func (q *Queries) PurgeableEvents(ctx context.Context, arg PurgeableEventsParams) (int64, error)

func (*Queries) RecordDeliveryAttempt

func (q *Queries) RecordDeliveryAttempt(ctx context.Context, arg RecordDeliveryAttemptParams) error

func (*Queries) RecordOverride

func (q *Queries) RecordOverride(ctx context.Context, arg RecordOverrideParams) (uuid.UUID, error)

func (*Queries) RecordSigningCheck

func (q *Queries) RecordSigningCheck(ctx context.Context, arg RecordSigningCheckParams) error

func (*Queries) RefusedByProvider

func (q *Queries) RefusedByProvider(ctx context.Context, tenantID uuid.UUID) ([]RefusedByProviderRow, error)

func (*Queries) RegisterAuthMethod

func (q *Queries) RegisterAuthMethod(ctx context.Context, name string) error

func (*Queries) RegisterDeliveryState

func (q *Queries) RegisterDeliveryState(ctx context.Context, arg RegisterDeliveryStateParams) error

func (*Queries) RegisterPermission

func (q *Queries) RegisterPermission(ctx context.Context, arg RegisterPermissionParams) error

func (*Queries) RegisterShippedGrant

func (q *Queries) RegisterShippedGrant(ctx context.Context, arg RegisterShippedGrantParams) error

func (*Queries) RegisterShippedRole

func (q *Queries) RegisterShippedRole(ctx context.Context, arg RegisterShippedRoleParams) (uuid.UUID, error)

A role Charon ships belongs to no tenant and is held in any. Its description is left alone once it exists, because a deployment is allowed to change it.

func (*Queries) RegisterSignatureState

func (q *Queries) RegisterSignatureState(ctx context.Context, arg RegisterSignatureStateParams) error

func (*Queries) RegisterTransport

func (q *Queries) RegisterTransport(ctx context.Context, name string) error

func (*Queries) RegisterVerifier

func (q *Queries) RegisterVerifier(ctx context.Context, name string) error

func (*Queries) RemoveSigningSecret

func (q *Queries) RemoveSigningSecret(ctx context.Context, arg RemoveSigningSecretParams) (int64, error)

func (*Queries) ReplayDelivery

func (q *Queries) ReplayDelivery(ctx context.Context, arg ReplayDeliveryParams) (int64, error)

A replay only reopens deliveries whose destination is still routed for this event's provider and still enabled. Anything else is history: the routes page is the truth about where events go.

func (*Queries) ReplayDestination

func (q *Queries) ReplayDestination(ctx context.Context, arg ReplayDestinationParams) (int64, error)

func (*Queries) ReplayEvent

func (q *Queries) ReplayEvent(ctx context.Context, arg ReplayEventParams) (int64, error)

func (*Queries) Retentions

func (q *Queries) Retentions(ctx context.Context) ([]RetentionsRow, error)

func (*Queries) Role

func (q *Queries) Role(ctx context.Context, arg RoleParams) (RoleRow, error)

A tenant may define a role of its own under a name Charon also ships, and changing a shipped role is how that happens. Its own wins, said here rather than left to whichever row the database hands back first: deciding what somebody may do cannot depend on that.

func (*Queries) RoleByID

func (q *Queries) RoleByID(ctx context.Context, id uuid.UUID) (RoleByIDRow, error)

func (*Queries) RoleIDByName

func (q *Queries) RoleIDByName(ctx context.Context, arg RoleIDByNameParams) (uuid.UUID, error)

func (*Queries) RoleWasChanged

func (q *Queries) RoleWasChanged(ctx context.Context, id uuid.UUID) (bool, error)

func (*Queries) Roles

func (q *Queries) Roles(ctx context.Context, tenantID pgtype.UUID) ([]RolesRow, error)

func (*Queries) RouteByID

func (q *Queries) RouteByID(ctx context.Context, arg RouteByIDParams) (RouteByIDRow, error)

func (*Queries) SearchEvents

func (q *Queries) SearchEvents(ctx context.Context, arg SearchEventsParams) ([]SearchEventsRow, error)

The state counts only take deliveries whose destination is still routed and enabled, so the numbers reconcile with the routes page. What is left over is reported apart as history.

func (*Queries) SetPanelUserTimeZone added in v0.3.0

func (q *Queries) SetPanelUserTimeZone(ctx context.Context, arg SetPanelUserTimeZoneParams) error

func (*Queries) SetProvider

func (q *Queries) SetProvider(ctx context.Context, arg SetProviderParams) error

func (*Queries) SetRetention

func (q *Queries) SetRetention(ctx context.Context, arg SetRetentionParams) (int64, error)

func (*Queries) SetRole

func (q *Queries) SetRole(ctx context.Context, arg SetRoleParams) (uuid.UUID, error)

Changing a role is what makes it the deployment's, and from then on starting leaves it alone.

func (*Queries) SetSystemAdmin

func (q *Queries) SetSystemAdmin(ctx context.Context, id uuid.UUID) (int64, error)

Becoming one means leaving the role behind, and with it the tenant the role belonged to; giving it up means being given a role again.

func (*Queries) SetSystemAdminByEmail

func (q *Queries) SetSystemAdminByEmail(ctx context.Context, email string) (int64, error)

func (*Queries) SignatureTotals

func (q *Queries) SignatureTotals(ctx context.Context) ([]SignatureTotalsRow, error)

func (*Queries) SigningFor

func (q *Queries) SigningFor(ctx context.Context, destinationID uuid.UUID) ([]SigningForRow, error)

func (*Queries) SigningSecrets

func (q *Queries) SigningSecrets(ctx context.Context, tenantID uuid.UUID) ([]SigningSecretsRow, error)

func (*Queries) SigningSecretsEverywhere

func (q *Queries) SigningSecretsEverywhere(ctx context.Context) ([]SigningSecretsEverywhereRow, error)

func (*Queries) SigningSecretsFor

func (q *Queries) SigningSecretsFor(ctx context.Context, destinationID uuid.UUID) ([]string, error)

func (*Queries) StopPointingValue

func (q *Queries) StopPointingValue(ctx context.Context, arg StopPointingValueParams) error

func (*Queries) SystemAdmins

func (q *Queries) SystemAdmins(ctx context.Context) ([]SystemAdminsRow, error)

func (*Queries) TenantBySlug

func (q *Queries) TenantBySlug(ctx context.Context, slug string) (Tenant, error)

func (*Queries) Tenants

func (q *Queries) Tenants(ctx context.Context) ([]Tenant, error)

func (*Queries) TenantsNamed

func (q *Queries) TenantsNamed(ctx context.Context, dollar_1 []string) ([]TenantsNamedRow, error)

func (*Queries) TryAgainAtTheNewAddress

func (q *Queries) TryAgainAtTheNewAddress(ctx context.Context, arg TryAgainAtTheNewAddressParams) (int64, error)

What failed against an address that was wrong did not fail against the destination, so a corrected address gets the attempts back and is tried at once rather than at the end of a backoff earned by a typo.

func (*Queries) UnplanEvent

func (q *Queries) UnplanEvent(ctx context.Context, arg UnplanEventParams) error

func (*Queries) UnplanProvider

func (q *Queries) UnplanProvider(ctx context.Context, arg UnplanProviderParams) (int64, error)

func (*Queries) UnroutedProviders

func (q *Queries) UnroutedProviders(ctx context.Context, tenantID uuid.UUID) ([]UnroutedProvidersRow, error)

func (*Queries) UnverifiedEvents

func (q *Queries) UnverifiedEvents(ctx context.Context, arg UnverifiedEventsParams) ([]UnverifiedEventsRow, error)

func (*Queries) UpdateDestination

func (q *Queries) UpdateDestination(ctx context.Context, arg UpdateDestinationParams) error

func (*Queries) UpdatePanelUserRole

func (q *Queries) UpdatePanelUserRole(ctx context.Context, arg UpdatePanelUserRoleParams) (int64, error)

func (*Queries) ValuesPointedAtTenant

func (q *Queries) ValuesPointedAtTenant(ctx context.Context, tenantID uuid.UUID) ([]ValuesPointedAtTenantRow, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type RecordDeliveryAttemptParams

type RecordDeliveryAttemptParams struct {
	DeliveryID        uuid.UUID
	Attempt           int32
	Status            pgtype.Int4
	Error             pgtype.Text
	DurationMs        int32
	SignedWith        string
	Response          []byte
	ResponseType      string
	ResponseTruncated bool
}

type RecordOverrideParams

type RecordOverrideParams struct {
	TenantID  uuid.UUID
	Reason    string
	DecidedBy uuid.UUID
}

type RecordSigningCheckParams

type RecordSigningCheckParams struct {
	SigningSecretID uuid.UUID
	TenantID        uuid.UUID
	Readable        bool
	Detail          string
}

type RefusedByProviderRow

type RefusedByProviderRow struct {
	Provider string
	Refused  int64
}

type RegisterDeliveryStateParams

type RegisterDeliveryStateParams struct {
	Name        string
	Description string
}

type RegisterPermissionParams

type RegisterPermissionParams struct {
	Name        string
	Description string
}

type RegisterShippedGrantParams

type RegisterShippedGrantParams struct {
	RoleID uuid.UUID
	Name   string
}

type RegisterShippedRoleParams

type RegisterShippedRoleParams struct {
	Name        string
	Description string
}

type RegisterSignatureStateParams

type RegisterSignatureStateParams struct {
	Name        string
	Description string
}

type RemoveSigningSecretParams

type RemoveSigningSecretParams struct {
	TenantID      uuid.UUID
	DestinationID uuid.UUID
	Reference     string
}

type ReplayDeliveryParams

type ReplayDeliveryParams struct {
	ID       uuid.UUID
	TenantID uuid.UUID
}

type ReplayDestinationParams

type ReplayDestinationParams struct {
	DestinationID uuid.UUID
	TenantID      uuid.UUID
}

type ReplayEventParams

type ReplayEventParams struct {
	EventID  uuid.UUID
	TenantID uuid.UUID
}

type RetentionsRow

type RetentionsRow struct {
	ID            uuid.UUID
	Slug          string
	RetentionDays pgtype.Int4
}

type Role

type Role struct {
	TenantID    pgtype.UUID
	Name        string
	Description string
	BuiltIn     bool
	CreatedAt   time.Time
	ID          uuid.UUID
	Changed     bool
}

type RoleByIDRow

type RoleByIDRow struct {
	TenantID pgtype.UUID
	Name     string
}

type RoleGrant

type RoleGrant struct {
	RoleID       uuid.UUID
	PermissionID uuid.UUID
}

type RoleIDByNameParams

type RoleIDByNameParams struct {
	TenantID pgtype.UUID
	Name     string
}

type RoleParams

type RoleParams struct {
	TenantID pgtype.UUID
	Name     string
}

type RoleRow

type RoleRow struct {
	Name        string
	Description string
	BuiltIn     bool
	Grants      []string
}

type RolesRow

type RolesRow struct {
	Name        string
	Description string
	BuiltIn     bool
	Grants      []string
}

type Route

type Route struct {
	ID            uuid.UUID
	Provider      string
	DestinationID uuid.UUID
	CreatedAt     time.Time
	TenantID      uuid.UUID
}

type RouteByIDParams

type RouteByIDParams struct {
	ID       uuid.UUID
	TenantID uuid.UUID
}

type RouteByIDRow

type RouteByIDRow struct {
	ID            uuid.UUID
	Provider      string
	DestinationID uuid.UUID
	Name          string
	Enabled       bool
	Url           string
}

type SchemaMigration

type SchemaMigration struct {
	Name      string
	AppliedAt time.Time
}

type SearchEventsParams

type SearchEventsParams struct {
	PageSize   int32
	TenantID   uuid.UUID
	Provider   pgtype.Text
	Since      pgtype.Timestamptz
	Until      pgtype.Timestamptz
	Signature  pgtype.Text
	State      pgtype.Text
	Search     pgtype.Text
	PageOffset int32
	LookAhead  int32
}

type SearchEventsRow

type SearchEventsRow struct {
	ID         uuid.UUID
	Provider   string
	Path       string
	ReceivedAt time.Time
	BodySize   int32
	Signature  string
	Planned    bool
	Forced     bool
	Deliveries int64
	Delivered  int64
	Dead       int64
	Pending    int64
	Unrouted   int64
	Attempts   int32
	Reachable  int32
}

type SetPanelUserTimeZoneParams added in v0.3.0

type SetPanelUserTimeZoneParams struct {
	ID       uuid.UUID
	TimeZone string
}

type SetProviderParams

type SetProviderParams struct {
	TenantID         uuid.UUID
	Name             string
	Verifier         string
	SecretEnv        string
	SignatureHeader  pgtype.Text
	ToleranceSeconds int32
	Scheme           string
	Algorithm        string
	Encoding         string
	TimestampKey     string
	SignatureKey     string
	VerifyTokenEnv   string
}

type SetRetentionParams

type SetRetentionParams struct {
	Slug          string
	RetentionDays pgtype.Int4
}

type SetRoleParams

type SetRoleParams struct {
	TenantID    pgtype.UUID
	Name        string
	Description string
}

type SignatureOverride

type SignatureOverride struct {
	ID        uuid.UUID
	TenantID  uuid.UUID
	Reason    string
	DecidedBy uuid.UUID
	DecidedAt time.Time
}

type SignatureState

type SignatureState struct {
	Name        string
	Description string
}

type SignatureTotalsRow

type SignatureTotalsRow struct {
	Signature string
	Total     int64
}

type SigningForRow

type SigningForRow struct {
	Reference string
	CreatedAt time.Time
	Readable  pgtype.Bool
	Detail    string
	CheckedAt pgtype.Timestamptz
}

type SigningSecret

type SigningSecret struct {
	ID            uuid.UUID
	TenantID      uuid.UUID
	DestinationID uuid.UUID
	Reference     string
	CreatedAt     time.Time
}

type SigningSecretCheck

type SigningSecretCheck struct {
	SigningSecretID uuid.UUID
	TenantID        uuid.UUID
	Readable        bool
	Detail          string
	CheckedAt       time.Time
}

type SigningSecretsEverywhereRow

type SigningSecretsEverywhereRow struct {
	ID        uuid.UUID
	TenantID  uuid.UUID
	Reference string
}

type SigningSecretsRow

type SigningSecretsRow struct {
	Destination string
	Reference   string
	CreatedAt   time.Time
}

type StopPointingValueParams

type StopPointingValueParams struct {
	Method   string
	Value    string
	TenantID uuid.UUID
}

type SystemAdminsRow

type SystemAdminsRow struct {
	ID          uuid.UUID
	Email       string
	OidcSubject pgtype.Text
	CreatedAt   time.Time
}

type Tenant

type Tenant struct {
	ID            uuid.UUID
	Slug          string
	Name          string
	CreatedAt     time.Time
	RetentionDays pgtype.Int4
}

type TenantsNamedRow

type TenantsNamedRow struct {
	ID   uuid.UUID
	Slug string
}

type Transport

type Transport struct {
	Name        string
	Description string
}

type TryAgainAtTheNewAddressParams

type TryAgainAtTheNewAddressParams struct {
	TenantID      uuid.UUID
	DestinationID uuid.UUID
}

type UnplanEventParams

type UnplanEventParams struct {
	ID       uuid.UUID
	TenantID uuid.UUID
}

type UnplanProviderParams

type UnplanProviderParams struct {
	Provider string
	TenantID uuid.UUID
}

type UnroutedProvidersRow

type UnroutedProvidersRow struct {
	Provider     string
	Events       int64
	LastReceived time.Time
}

type UnverifiedEventsParams

type UnverifiedEventsParams struct {
	TenantID uuid.UUID
	Provider string
	Limit    int32
}

type UnverifiedEventsRow

type UnverifiedEventsRow struct {
	ID       uuid.UUID
	Provider string
	Headers  []byte
	Body     []byte
}

type UpdateDestinationParams

type UpdateDestinationParams struct {
	ID       uuid.UUID
	Url      string
	Enabled  bool
	TenantID uuid.UUID
}

type UpdatePanelUserRoleParams

type UpdatePanelUserRoleParams struct {
	UserID   uuid.UUID
	TenantID uuid.UUID
	RoleID   pgtype.UUID
}

type ValuesPointedAtTenantRow

type ValuesPointedAtTenantRow struct {
	Method string
	Value  string
	Role   string
}

type Verifier

type Verifier struct {
	Name        string
	Description string
}

Jump to

Keyboard shortcuts

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