repo

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConflict = errors.New("repository conflict")
View Source
var ErrNotFound = errors.New("repository record not found")

Functions

func OpenPostgres added in v0.1.16

func OpenPostgres(databaseURL string) (*sql.DB, error)

Types

type AgentCredentialRecord

type AgentCredentialRecord struct {
	ID                  string
	OrganizationID      string
	AgentType           string
	AgentID             string
	CredentialHash      string
	RegistrationTokenID string
	ActivatedAt         string
	RevokedAt           string
	CreatedAt           string
	RotatedAt           string
}

type AgentCredentialRepository

type AgentCredentialRepository interface {
	FindCredentialByHash(ctx context.Context, credentialHash string) (AgentCredentialRecord, error)
	FindPendingCredentialByRegistrationToken(ctx context.Context, organizationID string, registrationTokenID string) (AgentCredentialRecord, error)
	CreateCredential(ctx context.Context, credential AgentCredentialRecord) error
	ActivateCredential(ctx context.Context, organizationID string, credentialID string, activatedAt string) error
	RevokeActiveCredentialsExcept(ctx context.Context, organizationID string, agentType string, agentID string, keepCredentialID string, revokedAt string) error
	RevokeCredential(ctx context.Context, organizationID string, credentialID string, revokedAt string) error
}

type AgentRegistrationTokenRecord

type AgentRegistrationTokenRecord struct {
	ID              string
	OrganizationID  string
	AgentType       string
	AgentID         string
	TokenHash       string
	ExpiresAt       string
	UsedAt          string
	RevokedAt       string
	CreatedAt       string
	CreatedByUserID string
}

type AgentRegistrationTokenRepository

type AgentRegistrationTokenRepository interface {
	ListRegistrationTokens(ctx context.Context, organizationID string, agentType string, agentID string) ([]AgentRegistrationTokenRecord, error)
	FindRegistrationTokenByHash(ctx context.Context, tokenHash string) (AgentRegistrationTokenRecord, error)
	CreateRegistrationToken(ctx context.Context, token AgentRegistrationTokenRecord) error
	ClaimRegistrationToken(ctx context.Context, organizationID string, tokenID string, claimedAt string) error
	ReleaseRegistrationTokenUse(ctx context.Context, organizationID string, tokenID string) error
	RevokeActiveUnusedRegistrationTokens(ctx context.Context, organizationID string, agentType string, agentID string, revokedAt string) error
	RevokeRegistrationToken(ctx context.Context, organizationID string, agentType string, agentID string, tokenID string, revokedAt string) error
}

type AuditLogRecord

type AuditLogRecord struct {
	ID                   string
	OrganizationID       string
	ActorUserID          string
	ActorRolesJSON       string
	ActorPermissionsJSON string
	Action               string
	ResourceType         string
	ResourceID           string
	Result               string
	ErrorMessage         string
	MetadataJSON         string
	SourceIP             string
	CreatedAt            string
}

type AuditLogRepository

type AuditLogRepository interface {
	CreateAuditLog(ctx context.Context, audit AuditLogRecord) error
}

type DNSCredentialRecord added in v0.1.19

type DNSCredentialRecord struct {
	ID              string
	OrganizationID  string
	Provider        string
	Name            string
	EncryptedSecret string
	CreatedAt       string
	UpdatedAt       string
	DeletedAt       string
}

type DNSCredentialRepository added in v0.1.19

type DNSCredentialRepository interface {
	ListDNSCredentialsByOrganization(ctx context.Context, organizationID string) ([]DNSCredentialRecord, error)
	FindDNSCredentialByID(ctx context.Context, organizationID string, credentialID string) (DNSCredentialRecord, error)
	ListDNSCredentialZonesByOrganization(ctx context.Context, organizationID string) ([]DNSCredentialZoneRecord, error)
	ListDNSCredentialZonesByCredential(ctx context.Context, organizationID string, credentialID string) ([]DNSCredentialZoneRecord, error)
	FindDNSCredentialZoneByID(ctx context.Context, organizationID string, credentialZoneID string) (DNSCredentialZoneRecord, error)
	CreateDNSCredential(ctx context.Context, credential DNSCredentialRecord) error
	UpdateDNSCredential(ctx context.Context, credential DNSCredentialRecord, replaceSecret bool) error
	ReplaceDNSCredentialZones(ctx context.Context, organizationID string, credentialID string, zones []DNSCredentialZoneRecord, now string, nextID func() string) error
	DeleteDNSCredential(ctx context.Context, organizationID string, credentialID string, deletedAt string) error
}

type DNSCredentialZoneRecord added in v0.1.20

type DNSCredentialZoneRecord struct {
	ID              string
	OrganizationID  string
	DNSCredentialID string
	ZoneID          string
	ZoneName        string
	Status          string
	LastSyncedAt    string
	CreatedAt       string
	UpdatedAt       string
}

type DNSInstanceRecord added in v0.1.20

type DNSInstanceRecord struct {
	ID                         string
	OrganizationID             string
	ManagedRecordID            string
	Name                       string
	Priority                   int
	Enabled                    bool
	NodeGroupIDsJSON           string
	AnswerCount                int
	ConditionJSON              string
	ActionJSON                 string
	NotificationChannelIDsJSON string
	LastOutputValuesJSON       string
	LastStatus                 string
	LastDiagnosticsJSON        string
	LastEvaluatedAt            string
	CreatedAt                  string
	UpdatedAt                  string
	DeletedAt                  string
}

type DNSManagedRecordRecord added in v0.1.20

type DNSManagedRecordRecord struct {
	ID                      string
	OrganizationID          string
	DNSCredentialID         string
	CredentialZoneID        string
	ZoneID                  string
	ZoneName                string
	RecordHost              string
	RecordName              string
	RecordType              string
	TTL                     int
	Proxied                 bool
	ActiveInstanceID        string
	LastAppliedValuesJSON   string
	ProviderRetirementsJSON string
	LastEvaluationStatus    string
	LastEvaluationError     string
	LastDiagnosticsJSON     string
	LastEvaluatedAt         string
	LastAppliedAt           string
	CreatedAt               string
	UpdatedAt               string
	DeletedAt               string
	Instances               []DNSInstanceRecord
}

type DNSRecordRepository added in v0.1.19

type DNSRecordRepository interface {
	ListDNSManagedRecordsByOrganization(ctx context.Context, organizationID string) ([]DNSManagedRecordRecord, error)
	FindDNSManagedRecordByID(ctx context.Context, organizationID string, recordID string) (DNSManagedRecordRecord, error)
	LockDNSManagedRecordEvaluation(ctx context.Context, organizationID string, recordID string) error
	CreateDNSManagedRecord(ctx context.Context, record DNSManagedRecordRecord) error
	UpdateDNSManagedRecord(ctx context.Context, record DNSManagedRecordRecord) error
	DeleteDNSManagedRecord(ctx context.Context, organizationID string, recordID string, deletedAt string) error
	ListDNSInstancesByOrganization(ctx context.Context, organizationID string) ([]DNSInstanceRecord, error)
	ListDNSInstancesByManagedRecord(ctx context.Context, organizationID string, recordID string) ([]DNSInstanceRecord, error)
	FindDNSInstanceByID(ctx context.Context, organizationID string, instanceID string) (DNSInstanceRecord, error)
	LockDNSInstanceMutation(ctx context.Context, organizationID string, instanceID string) error
	CreateDNSInstance(ctx context.Context, instance DNSInstanceRecord) error
	UpdateDNSInstance(ctx context.Context, instance DNSInstanceRecord) error
	DeleteDNSInstance(ctx context.Context, organizationID string, instanceID string, deletedAt string) error
	ClearDNSManagedRecordActiveInstance(ctx context.Context, organizationID string, instanceID string, updatedAt string) error
	UpdateDNSManagedRecordEvaluation(ctx context.Context, record DNSManagedRecordRecord) error
	UpdateDNSInstanceEvaluation(ctx context.Context, instance DNSInstanceRecord) error
	ListNotificationChannelsByOrganization(ctx context.Context, organizationID string) ([]NotificationChannelRecord, error)
	FindNotificationChannelByID(ctx context.Context, organizationID string, channelID string) (NotificationChannelRecord, error)
	CreateNotificationChannel(ctx context.Context, channel NotificationChannelRecord) error
	UpdateNotificationChannel(ctx context.Context, channel NotificationChannelRecord, replaceSecret bool) error
	DeleteNotificationChannel(ctx context.Context, organizationID string, channelID string, deletedAt string) error
	CreateNotificationDelivery(ctx context.Context, delivery NotificationDeliveryRecord) error
}

type HealthCheckMonitorScopeRecord added in v0.1.19

type HealthCheckMonitorScopeRecord struct {
	ID             string
	OrganizationID string
	HealthCheckID  string
	ScopeType      string
	MonitorID      string
	MonitorGroupID string
	CreatedAt      string
}

type HealthCheckRecord added in v0.1.19

type HealthCheckRecord struct {
	ID              string
	OrganizationID  string
	Name            string
	ProbeType       string
	IntervalSeconds int
	TimeoutSeconds  int
	ConfigJSON      string
	Enabled         bool
	CreatedAt       string
	UpdatedAt       string
	DeletedAt       string
	Targets         []HealthCheckTargetRecord
	MonitorScopes   []HealthCheckMonitorScopeRecord
}

type HealthCheckRepository added in v0.1.19

type HealthCheckRepository interface {
	ListHealthChecksByOrganization(ctx context.Context, organizationID string) ([]HealthCheckRecord, error)
	FindHealthCheckByID(ctx context.Context, organizationID string, healthCheckID string) (HealthCheckRecord, error)
	CreateHealthCheck(ctx context.Context, healthCheck HealthCheckRecord, targets []HealthCheckTargetRecord, monitorScopes []HealthCheckMonitorScopeRecord, now string, nextID func() string) error
	UpdateHealthCheck(ctx context.Context, healthCheck HealthCheckRecord, targets []HealthCheckTargetRecord, monitorScopes []HealthCheckMonitorScopeRecord, now string, nextID func() string) error
	SyncHealthCheckTargets(ctx context.Context, organizationID string, healthCheckID string, targets []HealthCheckTargetRecord, now string, nextID func() string) error
	DeleteHealthCheck(ctx context.Context, organizationID string, healthCheckID string, deletedAt string) error
	ListHealthResults(ctx context.Context, organizationID string, healthCheckID string, limit int) ([]HealthResultRecord, error)
	ListLatestHealthResultsByCheck(ctx context.Context, organizationID string, healthCheckID string) ([]HealthResultRecord, error)
	ListLatestHealthResultsByChecks(ctx context.Context, organizationID string, healthCheckIDs []string) (map[string][]HealthResultRecord, error)
	RecordHealthResults(ctx context.Context, organizationID string, results []HealthResultRecord) error
	ListHealthEvaluationRulesByCheck(ctx context.Context, organizationID string, healthCheckID string) ([]HealthEvaluationRuleRecord, error)
	CreateHealthEvaluationRule(ctx context.Context, rule HealthEvaluationRuleRecord, events []HealthEventRecord) error
}

type HealthCheckTargetRecord added in v0.1.19

type HealthCheckTargetRecord struct {
	ID             string
	OrganizationID string
	HealthCheckID  string
	ScopeType      string
	TargetID       string
	TargetGroupID  string
	TargetName     string
	TargetHost     string
	TargetPort     int
	CreatedAt      string
}

type HealthEvaluationRuleRecord added in v0.1.19

type HealthEvaluationRuleRecord struct {
	ID             string
	OrganizationID string
	HealthCheckID  string
	Name           string
	Enabled        bool
	ExpressionJSON string
	Events         []HealthEventRecord
	CreatedAt      string
	UpdatedAt      string
	DeletedAt      string
}

type HealthEventRecord added in v0.1.19

type HealthEventRecord struct {
	ID                     string
	OrganizationID         string
	HealthEvaluationRuleID string
	EventType              string
	ConfigJSON             string
	EncryptedSecret        string
	Enabled                bool
	CreatedAt              string
	UpdatedAt              string
	DeletedAt              string
}

type HealthResultRecord added in v0.1.19

type HealthResultRecord struct {
	ID                  string
	OrganizationID      string
	HealthCheckID       string
	HealthCheckTargetID string
	MonitorID           string
	TargetID            string
	Status              string
	LatencyMS           int
	ErrorMessage        string
	ObservedAt          string
	CreatedAt           string
}

type InboundBindingRecord

type InboundBindingRecord struct {
	ID             string
	OrganizationID string
	NodeGroupID    string
	ListenIP       string
	Protocol       string
	Port           int
	MatchType      string
	CreatedAt      string
}

type MemberRecord

type MemberRecord struct {
	ID             string
	OrganizationID string
	UserID         string
	UserEmail      string
	UserName       string
	Status         string
	CreatedAt      string
	UpdatedAt      string
}

type MemberRepository

type MemberRepository interface {
	FindMemberByUserAndOrganization(ctx context.Context, organizationID string, userID string) (MemberRecord, error)
	ListMembersByOrganization(ctx context.Context, organizationID string) ([]MemberRecord, error)
	CreateMember(ctx context.Context, member MemberRecord) error
	UpdateMemberStatus(ctx context.Context, organizationID string, memberID string, status string) error
	DeleteMember(ctx context.Context, organizationID string, memberID string) error
}

type MonitorGroupRecord

type MonitorGroupRecord struct {
	ID             string
	OrganizationID string
	Name           string
	Description    string
	CreatedAt      string
	UpdatedAt      string
	DeletedAt      string
}

type MonitorGroupRepository

type MonitorGroupRepository interface {
	ListMonitorGroupsByOrganization(ctx context.Context, organizationID string) ([]MonitorGroupRecord, error)
	FindMonitorGroupByID(ctx context.Context, organizationID string, monitorGroupID string) (MonitorGroupRecord, error)
	CreateMonitorGroup(ctx context.Context, monitorGroup MonitorGroupRecord) error
	UpdateMonitorGroup(ctx context.Context, monitorGroup MonitorGroupRecord) error
	DeleteMonitorGroup(ctx context.Context, organizationID string, monitorGroupID string, deletedAt string) error
}

type MonitorRecord

type MonitorRecord struct {
	ID                   string
	OrganizationID       string
	Name                 string
	Status               string
	DesiredConfigVersion int
	AppliedConfigVersion int
	LastSeenAt           string
	RegisteredAt         string
	CreatedAt            string
	UpdatedAt            string
	DeletedAt            string
	GroupIDs             []string
}

type MonitorRepository

type MonitorRepository interface {
	ListMonitorsByOrganization(ctx context.Context, organizationID string) ([]MonitorRecord, error)
	FindMonitorByID(ctx context.Context, organizationID string, monitorID string) (MonitorRecord, error)
	CreateMonitor(ctx context.Context, monitor MonitorRecord, groupIDs []string, now string, nextID func() string) error
	UpdateMonitor(ctx context.Context, monitor MonitorRecord, replaceGroups bool, groupIDs []string, now string, nextID func() string) error
	MarkMonitorAgentConnected(ctx context.Context, organizationID string, monitorID string, now string) error
	MarkMonitorAgentDisconnected(ctx context.Context, organizationID string, monitorID string, now string) error
	RecordMonitorConfigAck(ctx context.Context, organizationID string, monitorID string, configVersion int, now string) error
	DeleteMonitor(ctx context.Context, organizationID string, monitorID string, deletedAt string) error
}

type NodeAgentVersionRecord

type NodeAgentVersionRecord struct {
	Version   string
	Commit    string
	BuildTime string
}

type NodeConfigAckRecord added in v0.1.19

type NodeConfigAckRecord struct {
	ConfigVersion int
	Status        string
	ErrorMessage  string
	RetryCount    int
	NextRetryAt   string
}

type NodeDNSPublishAddressRecord added in v0.1.20

type NodeDNSPublishAddressRecord struct {
	ID             string
	OrganizationID string
	NodeID         string
	AddressType    string
	Address        string
	Source         string
	Enabled        bool
	ObservedAt     string
	CreatedAt      string
	UpdatedAt      string
}

type NodeGroupRecord

type NodeGroupRecord struct {
	ID             string
	OrganizationID string
	Name           string
	Description    string
	CreatedAt      string
	UpdatedAt      string
	DeletedAt      string
}

type NodeGroupRepository

type NodeGroupRepository interface {
	ListNodeGroupsByOrganization(ctx context.Context, organizationID string) ([]NodeGroupRecord, error)
	FindNodeGroupByID(ctx context.Context, organizationID string, nodeGroupID string) (NodeGroupRecord, error)
	CreateNodeGroup(ctx context.Context, nodeGroup NodeGroupRecord) error
	UpdateNodeGroup(ctx context.Context, nodeGroup NodeGroupRecord) error
	DeleteNodeGroup(ctx context.Context, organizationID string, nodeGroupID string, deletedAt string) error
}

type NodeListenIPRecord

type NodeListenIPRecord struct {
	ID             string
	OrganizationID string
	NodeID         string
	ListenIP       string
	DisplayName    string
	Enabled        bool
	CreatedAt      string
	UpdatedAt      string
}

type NodePortRangeRecord

type NodePortRangeRecord struct {
	ID             string
	OrganizationID string
	NodeID         string
	Protocol       string
	StartPort      int
	EndPort        int
	Enabled        bool
	CreatedAt      string
	UpdatedAt      string
}

type NodeRecord

type NodeRecord struct {
	ID                        string
	OrganizationID            string
	Name                      string
	Status                    string
	PublicDescription         string
	DesiredConfigVersion      int
	AppliedConfigVersion      int
	ConfigStatus              string
	ConfigErrorMessage        string
	ConfigStatusConfigVersion int
	ConfigRetryCount          int
	ConfigNextRetryAt         string
	ConfigStatusUpdatedAt     string
	LastSeenAt                string
	RegisteredAt              string
	AgentVersion              string
	AgentCommit               string
	AgentBuildTime            string
	AgentAutoUpdateEnabled    bool
	DesiredAgentVersion       string
	AgentUpdateStatus         string
	AgentUpdateError          string
	AgentUpdateStartedAt      string
	AgentUpdateFinishedAt     string
	CreatedAt                 string
	UpdatedAt                 string
	DeletedAt                 string
	GroupIDs                  []string
	ListenIPs                 []NodeListenIPRecord
	PortRanges                []NodePortRangeRecord
	DNSPublishAddresses       []NodeDNSPublishAddressRecord
}

type NodeRepository

type NodeRepository interface {
	ListNodesByOrganization(ctx context.Context, organizationID string) ([]NodeRecord, error)
	FindNodeByID(ctx context.Context, organizationID string, nodeID string) (NodeRecord, error)
	CreateNode(ctx context.Context, node NodeRecord, groupIDs []string, listenIPs []NodeListenIPRecord, portRanges []NodePortRangeRecord, now string, nextID func() string) error
	UpdateNode(ctx context.Context, node NodeRecord, replaceGroups bool, groupIDs []string, replaceListenIPs bool, listenIPs []NodeListenIPRecord, replacePortRanges bool, portRanges []NodePortRangeRecord, now string, nextID func() string) error
	MarkNodeAgentConnected(ctx context.Context, organizationID string, nodeID string, now string) error
	UpdateNodeAgentVersion(ctx context.Context, organizationID string, nodeID string, version NodeAgentVersionRecord, now string) error
	UpdateNodeAgentUpdatePolicy(ctx context.Context, organizationID string, nodeID string, enabled bool, now string) error
	MarkNodeAgentUpdateRequested(ctx context.Context, organizationID string, nodeID string, targetVersion string, now string) error
	MarkNodeAgentUpdateSatisfied(ctx context.Context, organizationID string, nodeID string, targetVersion string, now string) error
	RecordNodeAgentUpdateResult(ctx context.Context, organizationID string, nodeID string, status string, errorMessage string, now string) error
	MarkNodeAgentDisconnected(ctx context.Context, organizationID string, nodeID string, now string) error
	RecordNodeConfigAck(ctx context.Context, organizationID string, nodeID string, ack NodeConfigAckRecord, now string) error
	EnsureDesiredConfigVersionAtLeast(ctx context.Context, organizationID string, nodeID string, configVersion int, now string) error
	IncrementDesiredConfigForNode(ctx context.Context, organizationID string, nodeID string, now string) error
	IncrementDesiredConfigForNodeGroup(ctx context.Context, organizationID string, nodeGroupID string, now string) error
	DeleteNode(ctx context.Context, organizationID string, nodeID string, deletedAt string) error
}

type NotificationChannelRecord added in v0.1.20

type NotificationChannelRecord struct {
	ID              string
	OrganizationID  string
	Name            string
	ChannelType     string
	ConfigJSON      string
	EncryptedSecret string
	Enabled         bool
	CreatedAt       string
	UpdatedAt       string
	DeletedAt       string
}

type NotificationDeliveryRecord added in v0.1.20

type NotificationDeliveryRecord struct {
	ID                 string
	OrganizationID     string
	ChannelID          string
	DNSManagedRecordID string
	DNSInstanceID      string
	EventType          string
	Status             string
	ErrorMessage       string
	PayloadJSON        string
	CreatedAt          string
	DeliveredAt        string
}

type OrganizationRecord

type OrganizationRecord struct {
	ID                       string
	Name                     string
	Slug                     string
	OwnerUserID              string
	DefaultRuleLimit         int
	DefaultTrafficLimitBytes int64
	DefaultTrafficLimitMode  string
	CreatedAt                string
	UpdatedAt                string
	DeletedAt                string
}

type OrganizationRepository

type OrganizationRepository interface {
	CountOrganizations(ctx context.Context) (int, error)
	FindOrganizationByID(ctx context.Context, organizationID string) (OrganizationRecord, error)
	CreateOrganization(ctx context.Context, organization OrganizationRecord) error
	UpdateOrganization(ctx context.Context, organization OrganizationRecord) error
	ListOrganizations(ctx context.Context) ([]OrganizationRecord, error)
	ListOrganizationsByUserID(ctx context.Context, userID string) ([]OrganizationRecord, error)
}

type PostgresStore added in v0.1.16

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

func NewPostgresStore added in v0.1.16

func NewPostgresStore(db *sql.DB) *PostgresStore

func (*PostgresStore) ActivateCredential added in v0.1.16

func (store *PostgresStore) ActivateCredential(ctx context.Context, organizationID string, credentialID string, activatedAt string) error

func (*PostgresStore) AgentCredentials added in v0.1.16

func (store *PostgresStore) AgentCredentials() AgentCredentialRepository

func (*PostgresStore) AgentRegistrationTokens added in v0.1.16

func (store *PostgresStore) AgentRegistrationTokens() AgentRegistrationTokenRepository

func (*PostgresStore) AuditLogs added in v0.1.16

func (store *PostgresStore) AuditLogs() AuditLogRepository

func (*PostgresStore) ClaimRegistrationToken added in v0.1.16

func (store *PostgresStore) ClaimRegistrationToken(ctx context.Context, organizationID string, tokenID string, claimedAt string) error

func (*PostgresStore) ClearDNSManagedRecordActiveInstance added in v0.1.20

func (store *PostgresStore) ClearDNSManagedRecordActiveInstance(ctx context.Context, organizationID string, instanceID string, updatedAt string) error

func (*PostgresStore) CountOrganizations added in v0.1.16

func (store *PostgresStore) CountOrganizations(ctx context.Context) (int, error)

func (*PostgresStore) CountRulesByOrganization added in v0.1.16

func (store *PostgresStore) CountRulesByOrganization(ctx context.Context, organizationID string) (int, error)

func (*PostgresStore) CountRulesByOwner added in v0.1.16

func (store *PostgresStore) CountRulesByOwner(ctx context.Context, organizationID string, ownerUserID string) (int, error)

func (*PostgresStore) CreateAuditLog added in v0.1.16

func (store *PostgresStore) CreateAuditLog(ctx context.Context, audit AuditLogRecord) error

func (*PostgresStore) CreateCredential added in v0.1.16

func (store *PostgresStore) CreateCredential(ctx context.Context, credential AgentCredentialRecord) error

func (*PostgresStore) CreateDNSCredential added in v0.1.19

func (store *PostgresStore) CreateDNSCredential(ctx context.Context, credential DNSCredentialRecord) error

func (*PostgresStore) CreateDNSInstance added in v0.1.20

func (store *PostgresStore) CreateDNSInstance(ctx context.Context, instance DNSInstanceRecord) error

func (*PostgresStore) CreateDNSManagedRecord added in v0.1.20

func (store *PostgresStore) CreateDNSManagedRecord(ctx context.Context, record DNSManagedRecordRecord) error

func (*PostgresStore) CreateHealthCheck added in v0.1.19

func (store *PostgresStore) CreateHealthCheck(ctx context.Context, healthCheck HealthCheckRecord, targets []HealthCheckTargetRecord, monitorScopes []HealthCheckMonitorScopeRecord, now string, nextID func() string) error

func (*PostgresStore) CreateHealthEvaluationRule added in v0.1.19

func (store *PostgresStore) CreateHealthEvaluationRule(ctx context.Context, rule HealthEvaluationRuleRecord, events []HealthEventRecord) error

func (*PostgresStore) CreateMember added in v0.1.16

func (store *PostgresStore) CreateMember(ctx context.Context, member MemberRecord) error

func (*PostgresStore) CreateMonitor added in v0.1.16

func (store *PostgresStore) CreateMonitor(ctx context.Context, monitor MonitorRecord, groupIDs []string, now string, nextID func() string) error

func (*PostgresStore) CreateMonitorGroup added in v0.1.16

func (store *PostgresStore) CreateMonitorGroup(ctx context.Context, monitorGroup MonitorGroupRecord) error

func (*PostgresStore) CreateNode added in v0.1.16

func (store *PostgresStore) CreateNode(ctx context.Context, node NodeRecord, groupIDs []string, listenIPs []NodeListenIPRecord, portRanges []NodePortRangeRecord, now string, nextID func() string) error

func (*PostgresStore) CreateNodeGroup added in v0.1.16

func (store *PostgresStore) CreateNodeGroup(ctx context.Context, nodeGroup NodeGroupRecord) error

func (*PostgresStore) CreateNotificationChannel added in v0.1.20

func (store *PostgresStore) CreateNotificationChannel(ctx context.Context, channel NotificationChannelRecord) error

func (*PostgresStore) CreateNotificationDelivery added in v0.1.20

func (store *PostgresStore) CreateNotificationDelivery(ctx context.Context, delivery NotificationDeliveryRecord) error

func (*PostgresStore) CreateOrganization added in v0.1.16

func (store *PostgresStore) CreateOrganization(ctx context.Context, organization OrganizationRecord) error

func (*PostgresStore) CreateRegistrationToken added in v0.1.16

func (store *PostgresStore) CreateRegistrationToken(ctx context.Context, token AgentRegistrationTokenRecord) error

func (*PostgresStore) CreateRole added in v0.1.16

func (store *PostgresStore) CreateRole(ctx context.Context, role RoleRecord) error

func (*PostgresStore) CreateRule added in v0.1.16

func (store *PostgresStore) CreateRule(ctx context.Context, rule RuleRecord, binding InboundBindingRecord, tags []string, now string, nextID func() string) error

func (*PostgresStore) CreateTarget added in v0.1.16

func (store *PostgresStore) CreateTarget(ctx context.Context, target TargetRecord) error

func (*PostgresStore) CreateTargetGroup added in v0.1.16

func (store *PostgresStore) CreateTargetGroup(ctx context.Context, targetGroup TargetGroupRecord, members []TargetGroupMemberRecord, now string, nextID func() string) error

func (*PostgresStore) DNSCredentials added in v0.1.19

func (store *PostgresStore) DNSCredentials() DNSCredentialRepository

func (*PostgresStore) DNSRecords added in v0.1.19

func (store *PostgresStore) DNSRecords() DNSRecordRepository

func (*PostgresStore) DeleteDNSCredential added in v0.1.19

func (store *PostgresStore) DeleteDNSCredential(ctx context.Context, organizationID string, credentialID string, deletedAt string) error

func (*PostgresStore) DeleteDNSInstance added in v0.1.20

func (store *PostgresStore) DeleteDNSInstance(ctx context.Context, organizationID string, instanceID string, deletedAt string) error

func (*PostgresStore) DeleteDNSManagedRecord added in v0.1.20

func (store *PostgresStore) DeleteDNSManagedRecord(ctx context.Context, organizationID string, recordID string, deletedAt string) error

func (*PostgresStore) DeleteHealthCheck added in v0.1.19

func (store *PostgresStore) DeleteHealthCheck(ctx context.Context, organizationID string, healthCheckID string, deletedAt string) error

func (*PostgresStore) DeleteMember added in v0.1.16

func (store *PostgresStore) DeleteMember(ctx context.Context, organizationID string, memberID string) error

func (*PostgresStore) DeleteMonitor added in v0.1.16

func (store *PostgresStore) DeleteMonitor(ctx context.Context, organizationID string, monitorID string, deletedAt string) error

func (*PostgresStore) DeleteMonitorGroup added in v0.1.16

func (store *PostgresStore) DeleteMonitorGroup(ctx context.Context, organizationID string, monitorGroupID string, deletedAt string) error

func (*PostgresStore) DeleteNode added in v0.1.16

func (store *PostgresStore) DeleteNode(ctx context.Context, organizationID string, nodeID string, deletedAt string) error

func (*PostgresStore) DeleteNodeGroup added in v0.1.16

func (store *PostgresStore) DeleteNodeGroup(ctx context.Context, organizationID string, nodeGroupID string, deletedAt string) error

func (*PostgresStore) DeleteNotificationChannel added in v0.1.20

func (store *PostgresStore) DeleteNotificationChannel(ctx context.Context, organizationID string, channelID string, deletedAt string) error

func (*PostgresStore) DeleteRole added in v0.1.16

func (store *PostgresStore) DeleteRole(ctx context.Context, organizationID string, roleID string) error

func (*PostgresStore) DeleteRule added in v0.1.16

func (store *PostgresStore) DeleteRule(ctx context.Context, organizationID string, ruleID string, deletedAt string) error

func (*PostgresStore) DeleteRuleDeploymentForNode added in v0.1.19

func (store *PostgresStore) DeleteRuleDeploymentForNode(ctx context.Context, organizationID string, ruleID string, nodeID string) error

func (*PostgresStore) DeleteRuleDeployments added in v0.1.19

func (store *PostgresStore) DeleteRuleDeployments(ctx context.Context, organizationID string, ruleID string) error

func (*PostgresStore) DeleteTarget added in v0.1.16

func (store *PostgresStore) DeleteTarget(ctx context.Context, organizationID string, targetID string, deletedAt string) error

func (*PostgresStore) DeleteTargetGroup added in v0.1.16

func (store *PostgresStore) DeleteTargetGroup(ctx context.Context, organizationID string, targetGroupID string, deletedAt string) error

func (*PostgresStore) DisableAutoNodeDNSPublishAddresses added in v0.1.20

func (store *PostgresStore) DisableAutoNodeDNSPublishAddresses(ctx context.Context, organizationID string, nodeID string, now string) error

func (*PostgresStore) EnsureDesiredConfigVersionAtLeast added in v0.1.16

func (store *PostgresStore) EnsureDesiredConfigVersionAtLeast(ctx context.Context, organizationID string, nodeID string, configVersion int, now string) error

func (*PostgresStore) FindCredentialByHash added in v0.1.16

func (store *PostgresStore) FindCredentialByHash(ctx context.Context, credentialHash string) (AgentCredentialRecord, error)

func (*PostgresStore) FindDNSCredentialByID added in v0.1.19

func (store *PostgresStore) FindDNSCredentialByID(ctx context.Context, organizationID string, credentialID string) (DNSCredentialRecord, error)

func (*PostgresStore) FindDNSCredentialZoneByID added in v0.1.20

func (store *PostgresStore) FindDNSCredentialZoneByID(ctx context.Context, organizationID string, credentialZoneID string) (DNSCredentialZoneRecord, error)

func (*PostgresStore) FindDNSInstanceByID added in v0.1.20

func (store *PostgresStore) FindDNSInstanceByID(ctx context.Context, organizationID string, instanceID string) (DNSInstanceRecord, error)

func (*PostgresStore) FindDNSManagedRecordByID added in v0.1.20

func (store *PostgresStore) FindDNSManagedRecordByID(ctx context.Context, organizationID string, recordID string) (DNSManagedRecordRecord, error)

func (*PostgresStore) FindHealthCheckByID added in v0.1.19

func (store *PostgresStore) FindHealthCheckByID(ctx context.Context, organizationID string, healthCheckID string) (HealthCheckRecord, error)

func (*PostgresStore) FindMemberByUserAndOrganization added in v0.1.16

func (store *PostgresStore) FindMemberByUserAndOrganization(ctx context.Context, organizationID string, userID string) (MemberRecord, error)

func (*PostgresStore) FindMonitorByID added in v0.1.16

func (store *PostgresStore) FindMonitorByID(ctx context.Context, organizationID string, monitorID string) (MonitorRecord, error)

func (*PostgresStore) FindMonitorGroupByID added in v0.1.16

func (store *PostgresStore) FindMonitorGroupByID(ctx context.Context, organizationID string, monitorGroupID string) (MonitorGroupRecord, error)

func (*PostgresStore) FindNodeByID added in v0.1.16

func (store *PostgresStore) FindNodeByID(ctx context.Context, organizationID string, nodeID string) (NodeRecord, error)

func (*PostgresStore) FindNodeGroupByID added in v0.1.16

func (store *PostgresStore) FindNodeGroupByID(ctx context.Context, organizationID string, nodeGroupID string) (NodeGroupRecord, error)

func (*PostgresStore) FindNotificationChannelByID added in v0.1.20

func (store *PostgresStore) FindNotificationChannelByID(ctx context.Context, organizationID string, channelID string) (NotificationChannelRecord, error)

func (*PostgresStore) FindOrganizationByID added in v0.1.16

func (store *PostgresStore) FindOrganizationByID(ctx context.Context, organizationID string) (OrganizationRecord, error)

func (*PostgresStore) FindPendingCredentialByRegistrationToken added in v0.1.16

func (store *PostgresStore) FindPendingCredentialByRegistrationToken(ctx context.Context, organizationID string, registrationTokenID string) (AgentCredentialRecord, error)

func (*PostgresStore) FindRegistrationTokenByHash added in v0.1.16

func (store *PostgresStore) FindRegistrationTokenByHash(ctx context.Context, tokenHash string) (AgentRegistrationTokenRecord, error)

func (*PostgresStore) FindRoleByID added in v0.1.16

func (store *PostgresStore) FindRoleByID(ctx context.Context, organizationID string, roleID string) (RoleRecord, error)

func (*PostgresStore) FindRuleByID added in v0.1.16

func (store *PostgresStore) FindRuleByID(ctx context.Context, organizationID string, ruleID string) (RuleRecord, error)

func (*PostgresStore) FindTargetByID added in v0.1.16

func (store *PostgresStore) FindTargetByID(ctx context.Context, organizationID string, targetID string) (TargetRecord, error)

func (*PostgresStore) FindTargetGroupByID added in v0.1.16

func (store *PostgresStore) FindTargetGroupByID(ctx context.Context, organizationID string, targetGroupID string) (TargetGroupRecord, error)

func (*PostgresStore) FindUserByEmail added in v0.1.16

func (store *PostgresStore) FindUserByEmail(ctx context.Context, email string) (UserRecord, error)

func (*PostgresStore) FindUserByID added in v0.1.16

func (store *PostgresStore) FindUserByID(ctx context.Context, userID string) (UserRecord, error)

func (*PostgresStore) HealthChecks added in v0.1.19

func (store *PostgresStore) HealthChecks() HealthCheckRepository

func (*PostgresStore) IncrementDesiredConfigForNode added in v0.1.16

func (store *PostgresStore) IncrementDesiredConfigForNode(ctx context.Context, organizationID string, nodeID string, now string) error

func (*PostgresStore) IncrementDesiredConfigForNodeGroup added in v0.1.16

func (store *PostgresStore) IncrementDesiredConfigForNodeGroup(ctx context.Context, organizationID string, nodeGroupID string, now string) error

func (*PostgresStore) ListDNSCredentialZonesByCredential added in v0.1.20

func (store *PostgresStore) ListDNSCredentialZonesByCredential(ctx context.Context, organizationID string, credentialID string) ([]DNSCredentialZoneRecord, error)

func (*PostgresStore) ListDNSCredentialZonesByOrganization added in v0.1.20

func (store *PostgresStore) ListDNSCredentialZonesByOrganization(ctx context.Context, organizationID string) ([]DNSCredentialZoneRecord, error)

func (*PostgresStore) ListDNSCredentialsByOrganization added in v0.1.19

func (store *PostgresStore) ListDNSCredentialsByOrganization(ctx context.Context, organizationID string) ([]DNSCredentialRecord, error)

func (*PostgresStore) ListDNSInstancesByManagedRecord added in v0.1.20

func (store *PostgresStore) ListDNSInstancesByManagedRecord(ctx context.Context, organizationID string, recordID string) ([]DNSInstanceRecord, error)

func (*PostgresStore) ListDNSInstancesByOrganization added in v0.1.20

func (store *PostgresStore) ListDNSInstancesByOrganization(ctx context.Context, organizationID string) ([]DNSInstanceRecord, error)

func (*PostgresStore) ListDNSManagedRecordsByOrganization added in v0.1.20

func (store *PostgresStore) ListDNSManagedRecordsByOrganization(ctx context.Context, organizationID string) ([]DNSManagedRecordRecord, error)

func (*PostgresStore) ListEnabledInboundBindings added in v0.1.16

func (store *PostgresStore) ListEnabledInboundBindings(ctx context.Context, organizationID string) ([]RuleRecord, error)

func (*PostgresStore) ListForMember added in v0.1.16

func (store *PostgresStore) ListForMember(ctx context.Context, organizationID string, memberID string) ([]RoleRecord, error)

func (*PostgresStore) ListHealthChecksByOrganization added in v0.1.19

func (store *PostgresStore) ListHealthChecksByOrganization(ctx context.Context, organizationID string) ([]HealthCheckRecord, error)

func (*PostgresStore) ListHealthEvaluationRulesByCheck added in v0.1.19

func (store *PostgresStore) ListHealthEvaluationRulesByCheck(ctx context.Context, organizationID string, healthCheckID string) ([]HealthEvaluationRuleRecord, error)

func (*PostgresStore) ListHealthResults added in v0.1.19

func (store *PostgresStore) ListHealthResults(ctx context.Context, organizationID string, healthCheckID string, limit int) ([]HealthResultRecord, error)

func (*PostgresStore) ListLatestHealthResultsByCheck added in v0.1.19

func (store *PostgresStore) ListLatestHealthResultsByCheck(ctx context.Context, organizationID string, healthCheckID string) ([]HealthResultRecord, error)

func (*PostgresStore) ListLatestHealthResultsByChecks added in v0.1.20

func (store *PostgresStore) ListLatestHealthResultsByChecks(ctx context.Context, organizationID string, healthCheckIDs []string) (map[string][]HealthResultRecord, error)

func (*PostgresStore) ListMembersByOrganization added in v0.1.16

func (store *PostgresStore) ListMembersByOrganization(ctx context.Context, organizationID string) ([]MemberRecord, error)

func (*PostgresStore) ListMonitorGroupsByOrganization added in v0.1.16

func (store *PostgresStore) ListMonitorGroupsByOrganization(ctx context.Context, organizationID string) ([]MonitorGroupRecord, error)

func (*PostgresStore) ListMonitorsByOrganization added in v0.1.16

func (store *PostgresStore) ListMonitorsByOrganization(ctx context.Context, organizationID string) ([]MonitorRecord, error)

func (*PostgresStore) ListNodeDNSPublishAddresses added in v0.1.20

func (store *PostgresStore) ListNodeDNSPublishAddresses(ctx context.Context, organizationID string, nodeID string) ([]NodeDNSPublishAddressRecord, error)

func (*PostgresStore) ListNodeGroupsByOrganization added in v0.1.16

func (store *PostgresStore) ListNodeGroupsByOrganization(ctx context.Context, organizationID string) ([]NodeGroupRecord, error)

func (*PostgresStore) ListNodesByOrganization added in v0.1.16

func (store *PostgresStore) ListNodesByOrganization(ctx context.Context, organizationID string) ([]NodeRecord, error)

func (*PostgresStore) ListNotificationChannelsByOrganization added in v0.1.20

func (store *PostgresStore) ListNotificationChannelsByOrganization(ctx context.Context, organizationID string) ([]NotificationChannelRecord, error)

func (*PostgresStore) ListOrganizations added in v0.1.16

func (store *PostgresStore) ListOrganizations(ctx context.Context) ([]OrganizationRecord, error)

func (*PostgresStore) ListOrganizationsByUserID added in v0.1.16

func (store *PostgresStore) ListOrganizationsByUserID(ctx context.Context, userID string) ([]OrganizationRecord, error)

func (*PostgresStore) ListQuotasByOrganization added in v0.1.16

func (store *PostgresStore) ListQuotasByOrganization(ctx context.Context, organizationID string) ([]QuotaRecord, error)

func (*PostgresStore) ListRegistrationTokens added in v0.1.16

func (store *PostgresStore) ListRegistrationTokens(ctx context.Context, organizationID string, agentType string, agentID string) ([]AgentRegistrationTokenRecord, error)

func (*PostgresStore) ListRolesByOrganization added in v0.1.16

func (store *PostgresStore) ListRolesByOrganization(ctx context.Context, organizationID string) ([]RoleRecord, error)

func (*PostgresStore) ListRuleDeploymentsByOrganization added in v0.1.19

func (store *PostgresStore) ListRuleDeploymentsByOrganization(ctx context.Context, organizationID string) ([]RuleDeploymentRecord, error)

func (*PostgresStore) ListRulesByOrganization added in v0.1.16

func (store *PostgresStore) ListRulesByOrganization(ctx context.Context, organizationID string) ([]RuleRecord, error)

func (*PostgresStore) ListTargetGroupsByOrganization added in v0.1.16

func (store *PostgresStore) ListTargetGroupsByOrganization(ctx context.Context, organizationID string) ([]TargetGroupRecord, error)

func (*PostgresStore) ListTargetsByOrganization added in v0.1.16

func (store *PostgresStore) ListTargetsByOrganization(ctx context.Context, organizationID string) ([]TargetRecord, error)

func (*PostgresStore) LockDNSInstanceMutation added in v0.1.20

func (store *PostgresStore) LockDNSInstanceMutation(ctx context.Context, organizationID string, instanceID string) error

func (*PostgresStore) LockDNSManagedRecordEvaluation added in v0.1.20

func (store *PostgresStore) LockDNSManagedRecordEvaluation(ctx context.Context, organizationID string, recordID string) error

func (*PostgresStore) MarkMonitorAgentConnected added in v0.1.16

func (store *PostgresStore) MarkMonitorAgentConnected(ctx context.Context, organizationID string, monitorID string, now string) error

func (*PostgresStore) MarkMonitorAgentDisconnected added in v0.1.16

func (store *PostgresStore) MarkMonitorAgentDisconnected(ctx context.Context, organizationID string, monitorID string, now string) error

func (*PostgresStore) MarkNodeAgentConnected added in v0.1.16

func (store *PostgresStore) MarkNodeAgentConnected(ctx context.Context, organizationID string, nodeID string, now string) error

func (*PostgresStore) MarkNodeAgentDisconnected added in v0.1.16

func (store *PostgresStore) MarkNodeAgentDisconnected(ctx context.Context, organizationID string, nodeID string, now string) error

func (*PostgresStore) MarkNodeAgentUpdateRequested added in v0.1.16

func (store *PostgresStore) MarkNodeAgentUpdateRequested(ctx context.Context, organizationID string, nodeID string, targetVersion string, now string) error

func (*PostgresStore) MarkNodeAgentUpdateSatisfied added in v0.1.16

func (store *PostgresStore) MarkNodeAgentUpdateSatisfied(ctx context.Context, organizationID string, nodeID string, targetVersion string, now string) error

func (*PostgresStore) Members added in v0.1.16

func (store *PostgresStore) Members() MemberRepository

func (*PostgresStore) MonitorGroups added in v0.1.16

func (store *PostgresStore) MonitorGroups() MonitorGroupRepository

func (*PostgresStore) Monitors added in v0.1.16

func (store *PostgresStore) Monitors() MonitorRepository

func (*PostgresStore) NodeGroups added in v0.1.16

func (store *PostgresStore) NodeGroups() NodeGroupRepository

func (*PostgresStore) Nodes added in v0.1.16

func (store *PostgresStore) Nodes() NodeRepository

func (*PostgresStore) Organizations added in v0.1.16

func (store *PostgresStore) Organizations() OrganizationRepository

func (*PostgresStore) Quotas added in v0.1.16

func (store *PostgresStore) Quotas() QuotaRepository

func (*PostgresStore) RecordHealthResults added in v0.1.19

func (store *PostgresStore) RecordHealthResults(ctx context.Context, organizationID string, results []HealthResultRecord) error

func (*PostgresStore) RecordMonitorConfigAck added in v0.1.19

func (store *PostgresStore) RecordMonitorConfigAck(ctx context.Context, organizationID string, monitorID string, configVersion int, now string) error

func (*PostgresStore) RecordNodeAgentUpdateResult added in v0.1.16

func (store *PostgresStore) RecordNodeAgentUpdateResult(ctx context.Context, organizationID string, nodeID string, status string, errorMessage string, now string) error

func (*PostgresStore) RecordNodeConfigAck added in v0.1.16

func (store *PostgresStore) RecordNodeConfigAck(ctx context.Context, organizationID string, nodeID string, ack NodeConfigAckRecord, now string) error

func (*PostgresStore) RecordNodeRuleTrafficAssignments added in v0.1.18

func (store *PostgresStore) RecordNodeRuleTrafficAssignments(ctx context.Context, organizationID string, nodeID string, ruleIDs []string, now string) error

func (*PostgresStore) RecordRuleDeploymentApplied added in v0.1.19

func (store *PostgresStore) RecordRuleDeploymentApplied(ctx context.Context, organizationID string, nodeID string, configVersion int, deployments []RuleDeploymentAppliedRecord, now string, nextID func() string) error

func (*PostgresStore) RecordRuleDeploymentFailures added in v0.1.19

func (store *PostgresStore) RecordRuleDeploymentFailures(ctx context.Context, organizationID string, nodeID string, configVersion int, failures []RuleDeploymentFailureRecord, now string, nextID func() string) error

func (*PostgresStore) RecordRuleTrafficReport added in v0.1.18

func (store *PostgresStore) RecordRuleTrafficReport(ctx context.Context, organizationID string, agentID string, report RuleTrafficReportRecord, deltas []RuleTrafficDeltaRecord, now string, nextID func() string) (bool, error)

func (*PostgresStore) ReleaseRegistrationTokenUse added in v0.1.16

func (store *PostgresStore) ReleaseRegistrationTokenUse(ctx context.Context, organizationID string, tokenID string) error

func (*PostgresStore) ReplaceDNSCredentialZones added in v0.1.20

func (store *PostgresStore) ReplaceDNSCredentialZones(ctx context.Context, organizationID string, credentialID string, zones []DNSCredentialZoneRecord, now string, nextID func() string) error

func (*PostgresStore) ReplaceManualNodeDNSPublishAddresses added in v0.1.20

func (store *PostgresStore) ReplaceManualNodeDNSPublishAddresses(ctx context.Context, organizationID string, nodeID string, addresses []NodeDNSPublishAddressRecord, now string, nextID func() string) error

func (*PostgresStore) ReplaceMemberRoles added in v0.1.16

func (store *PostgresStore) ReplaceMemberRoles(ctx context.Context, organizationID string, memberID string, roleIDs []string, now string, nextID func() string) error

func (*PostgresStore) ReplacePermissions added in v0.1.16

func (store *PostgresStore) ReplacePermissions(ctx context.Context, organizationID string, roleID string, permissions []string, now string, nextID func() string) error

func (*PostgresStore) ReplaceResourceScopes added in v0.1.16

func (store *PostgresStore) ReplaceResourceScopes(ctx context.Context, organizationID string, roleID string, scopes []ResourceScopeRecord, now string, nextID func() string) error

func (*PostgresStore) ReplaceRuleDeploymentPending added in v0.1.19

func (store *PostgresStore) ReplaceRuleDeploymentPending(ctx context.Context, organizationID string, rule RuleRecord, deployments []RuleDeploymentPendingRecord, now string, nextID func() string) error

func (*PostgresStore) RevokeActiveCredentialsExcept added in v0.1.16

func (store *PostgresStore) RevokeActiveCredentialsExcept(ctx context.Context, organizationID string, agentType string, agentID string, keepCredentialID string, revokedAt string) error

func (*PostgresStore) RevokeActiveUnusedRegistrationTokens added in v0.1.16

func (store *PostgresStore) RevokeActiveUnusedRegistrationTokens(ctx context.Context, organizationID string, agentType string, agentID string, revokedAt string) error

func (*PostgresStore) RevokeCredential added in v0.1.16

func (store *PostgresStore) RevokeCredential(ctx context.Context, organizationID string, credentialID string, revokedAt string) error

func (*PostgresStore) RevokeRegistrationToken added in v0.1.16

func (store *PostgresStore) RevokeRegistrationToken(ctx context.Context, organizationID string, agentType string, agentID string, tokenID string, revokedAt string) error

func (*PostgresStore) Roles added in v0.1.16

func (store *PostgresStore) Roles() RoleRepository

func (*PostgresStore) Rules added in v0.1.16

func (store *PostgresStore) Rules() RuleRepository

func (*PostgresStore) SumRuleTraffic added in v0.1.16

func (store *PostgresStore) SumRuleTraffic(ctx context.Context, organizationID string, ruleID string) (RuleTrafficRecord, error)

func (*PostgresStore) SyncHealthCheckTargets added in v0.1.19

func (store *PostgresStore) SyncHealthCheckTargets(ctx context.Context, organizationID string, healthCheckID string, targets []HealthCheckTargetRecord, now string, nextID func() string) error

func (*PostgresStore) TargetGroups added in v0.1.16

func (store *PostgresStore) TargetGroups() TargetGroupRepository

func (*PostgresStore) Targets added in v0.1.16

func (store *PostgresStore) Targets() TargetRepository

func (*PostgresStore) UpdateDNSCredential added in v0.1.19

func (store *PostgresStore) UpdateDNSCredential(ctx context.Context, credential DNSCredentialRecord, replaceSecret bool) error

func (*PostgresStore) UpdateDNSInstance added in v0.1.20

func (store *PostgresStore) UpdateDNSInstance(ctx context.Context, instance DNSInstanceRecord) error

func (*PostgresStore) UpdateDNSInstanceEvaluation added in v0.1.20

func (store *PostgresStore) UpdateDNSInstanceEvaluation(ctx context.Context, instance DNSInstanceRecord) error

func (*PostgresStore) UpdateDNSManagedRecord added in v0.1.20

func (store *PostgresStore) UpdateDNSManagedRecord(ctx context.Context, record DNSManagedRecordRecord) error

func (*PostgresStore) UpdateDNSManagedRecordEvaluation added in v0.1.20

func (store *PostgresStore) UpdateDNSManagedRecordEvaluation(ctx context.Context, record DNSManagedRecordRecord) error

func (*PostgresStore) UpdateHealthCheck added in v0.1.19

func (store *PostgresStore) UpdateHealthCheck(ctx context.Context, healthCheck HealthCheckRecord, targets []HealthCheckTargetRecord, monitorScopes []HealthCheckMonitorScopeRecord, now string, nextID func() string) error

func (*PostgresStore) UpdateMemberStatus added in v0.1.16

func (store *PostgresStore) UpdateMemberStatus(ctx context.Context, organizationID string, memberID string, status string) error

func (*PostgresStore) UpdateMonitor added in v0.1.16

func (store *PostgresStore) UpdateMonitor(ctx context.Context, monitor MonitorRecord, replaceGroups bool, groupIDs []string, now string, nextID func() string) error

func (*PostgresStore) UpdateMonitorGroup added in v0.1.16

func (store *PostgresStore) UpdateMonitorGroup(ctx context.Context, monitorGroup MonitorGroupRecord) error

func (*PostgresStore) UpdateNode added in v0.1.16

func (store *PostgresStore) UpdateNode(ctx context.Context, node NodeRecord, replaceGroups bool, groupIDs []string, replaceListenIPs bool, listenIPs []NodeListenIPRecord, replacePortRanges bool, portRanges []NodePortRangeRecord, now string, nextID func() string) error

func (*PostgresStore) UpdateNodeAgentUpdatePolicy added in v0.1.16

func (store *PostgresStore) UpdateNodeAgentUpdatePolicy(ctx context.Context, organizationID string, nodeID string, enabled bool, now string) error

func (*PostgresStore) UpdateNodeAgentVersion added in v0.1.16

func (store *PostgresStore) UpdateNodeAgentVersion(ctx context.Context, organizationID string, nodeID string, version NodeAgentVersionRecord, now string) error

func (*PostgresStore) UpdateNodeGroup added in v0.1.16

func (store *PostgresStore) UpdateNodeGroup(ctx context.Context, nodeGroup NodeGroupRecord) error

func (*PostgresStore) UpdateNotificationChannel added in v0.1.20

func (store *PostgresStore) UpdateNotificationChannel(ctx context.Context, channel NotificationChannelRecord, replaceSecret bool) error

func (*PostgresStore) UpdateOrganization added in v0.1.16

func (store *PostgresStore) UpdateOrganization(ctx context.Context, organization OrganizationRecord) error

func (*PostgresStore) UpdateRole added in v0.1.16

func (store *PostgresStore) UpdateRole(ctx context.Context, role RoleRecord) error

func (*PostgresStore) UpdateRule added in v0.1.16

func (store *PostgresStore) UpdateRule(ctx context.Context, rule RuleRecord, binding InboundBindingRecord, tags []string, now string, nextID func() string) error

func (*PostgresStore) UpdateTarget added in v0.1.16

func (store *PostgresStore) UpdateTarget(ctx context.Context, target TargetRecord) error

func (*PostgresStore) UpdateTargetGroup added in v0.1.16

func (store *PostgresStore) UpdateTargetGroup(ctx context.Context, targetGroup TargetGroupRecord, members []TargetGroupMemberRecord, now string, nextID func() string) error

func (*PostgresStore) UpsertAutoNodeDNSPublishAddress added in v0.1.20

func (store *PostgresStore) UpsertAutoNodeDNSPublishAddress(ctx context.Context, organizationID string, nodeID string, addressType string, address string, now string, nextID func() string) error

func (*PostgresStore) UpsertRuleDeploymentPending added in v0.1.19

func (store *PostgresStore) UpsertRuleDeploymentPending(ctx context.Context, organizationID string, rule RuleRecord, deployment RuleDeploymentPendingRecord, now string, nextID func() string) error

func (*PostgresStore) Users added in v0.1.16

func (store *PostgresStore) Users() UserRepository

func (*PostgresStore) WithinTx added in v0.1.16

func (store *PostgresStore) WithinTx(ctx context.Context, fn func(ctx context.Context, repositories Repositories) error) error

type QuotaRecord

type QuotaRecord struct {
	ID                string
	OrganizationID    string
	Scope             string
	SubjectUserID     string
	SubjectRuleID     string
	RuleLimit         int
	TrafficLimitBytes int64
	TrafficLimitMode  string
	OverLimitAction   string
	CreatedAt         string
	UpdatedAt         string
}

type QuotaRepository

type QuotaRepository interface {
	ListQuotasByOrganization(ctx context.Context, organizationID string) ([]QuotaRecord, error)
}

type Repositories

type Repositories interface {
	Users() UserRepository
	Organizations() OrganizationRepository
	Members() MemberRepository
	Roles() RoleRepository
	NodeGroups() NodeGroupRepository
	Nodes() NodeRepository
	MonitorGroups() MonitorGroupRepository
	Monitors() MonitorRepository
	HealthChecks() HealthCheckRepository
	DNSCredentials() DNSCredentialRepository
	DNSRecords() DNSRecordRepository
	Targets() TargetRepository
	TargetGroups() TargetGroupRepository
	Rules() RuleRepository
	Quotas() QuotaRepository
	AgentRegistrationTokens() AgentRegistrationTokenRepository
	AgentCredentials() AgentCredentialRepository
	AuditLogs() AuditLogRepository
}

type ResourceScopeRecord

type ResourceScopeRecord struct {
	ID             string
	OrganizationID string
	RoleID         string
	ResourceType   string
	ResourceID     string
	AccessLevel    string
	CreatedAt      string
}

type RoleRecord

type RoleRecord struct {
	ID             string
	OrganizationID string
	Key            string
	Name           string
	Description    string
	IsSystem       bool
	Permissions    []string
	ResourceScopes []ResourceScopeRecord
	CreatedAt      string
	UpdatedAt      string
	DeletedAt      string
}

type RoleRepository

type RoleRepository interface {
	ListRolesByOrganization(ctx context.Context, organizationID string) ([]RoleRecord, error)
	FindRoleByID(ctx context.Context, organizationID string, roleID string) (RoleRecord, error)
	CreateRole(ctx context.Context, role RoleRecord) error
	UpdateRole(ctx context.Context, role RoleRecord) error
	DeleteRole(ctx context.Context, organizationID string, roleID string) error
	ReplacePermissions(ctx context.Context, organizationID string, roleID string, permissions []string, now string, nextID func() string) error
	ReplaceResourceScopes(ctx context.Context, organizationID string, roleID string, scopes []ResourceScopeRecord, now string, nextID func() string) error
	ReplaceMemberRoles(ctx context.Context, organizationID string, memberID string, roleIDs []string, now string, nextID func() string) error
	ListForMember(ctx context.Context, organizationID string, memberID string) ([]RoleRecord, error)
}

type RuleDeploymentAppliedRecord added in v0.1.19

type RuleDeploymentAppliedRecord struct {
	RuleID            string
	RuleConfigVersion int
}

type RuleDeploymentFailureRecord added in v0.1.19

type RuleDeploymentFailureRecord struct {
	RuleID            string
	RuleConfigVersion int
	ErrorCode         string
	ErrorMessage      string
	Protocol          string
	ListenIP          string
	Port              int
}

type RuleDeploymentPendingRecord added in v0.1.19

type RuleDeploymentPendingRecord struct {
	NodeID        string
	ConfigVersion int
}

type RuleDeploymentRecord added in v0.1.19

type RuleDeploymentRecord struct {
	ID                string
	OrganizationID    string
	RuleID            string
	NodeID            string
	ConfigVersion     int
	RuleConfigVersion int
	Status            string
	ErrorCode         string
	ErrorMessage      string
	Protocol          string
	ListenIP          string
	Port              int
	UpdatedAt         string
}

type RuleRecord

type RuleRecord struct {
	ID               string
	OrganizationID   string
	OwnerUserID      string
	Name             string
	Enabled          bool
	Status           string
	ForwardingType   string
	Protocol         string
	MatchType        string
	InboundBindingID string
	SNIHostname      string
	TargetType       string
	TargetID         string
	TargetGroupID    string
	ProxyProtocolIn  string
	ProxyProtocolOut string
	FailurePolicy    string
	ConfigVersion    int
	CreatedAt        string
	UpdatedAt        string
	DeletedAt        string
	Binding          InboundBindingRecord
	Tags             []string
}

type RuleRepository

type RuleRepository interface {
	ListRulesByOrganization(ctx context.Context, organizationID string) ([]RuleRecord, error)
	FindRuleByID(ctx context.Context, organizationID string, ruleID string) (RuleRecord, error)
	CreateRule(ctx context.Context, rule RuleRecord, binding InboundBindingRecord, tags []string, now string, nextID func() string) error
	UpdateRule(ctx context.Context, rule RuleRecord, binding InboundBindingRecord, tags []string, now string, nextID func() string) error
	DeleteRule(ctx context.Context, organizationID string, ruleID string, deletedAt string) error
	ListEnabledInboundBindings(ctx context.Context, organizationID string) ([]RuleRecord, error)
	CountRulesByOrganization(ctx context.Context, organizationID string) (int, error)
	CountRulesByOwner(ctx context.Context, organizationID string, ownerUserID string) (int, error)
	SumRuleTraffic(ctx context.Context, organizationID string, ruleID string) (RuleTrafficRecord, error)
	RecordNodeRuleTrafficAssignments(ctx context.Context, organizationID string, nodeID string, ruleIDs []string, now string) error
	RecordRuleTrafficReport(ctx context.Context, organizationID string, agentID string, report RuleTrafficReportRecord, deltas []RuleTrafficDeltaRecord, now string, nextID func() string) (bool, error)
	ListRuleDeploymentsByOrganization(ctx context.Context, organizationID string) ([]RuleDeploymentRecord, error)
	ReplaceRuleDeploymentPending(ctx context.Context, organizationID string, rule RuleRecord, deployments []RuleDeploymentPendingRecord, now string, nextID func() string) error
	UpsertRuleDeploymentPending(ctx context.Context, organizationID string, rule RuleRecord, deployment RuleDeploymentPendingRecord, now string, nextID func() string) error
	RecordRuleDeploymentApplied(ctx context.Context, organizationID string, nodeID string, configVersion int, deployments []RuleDeploymentAppliedRecord, now string, nextID func() string) error
	RecordRuleDeploymentFailures(ctx context.Context, organizationID string, nodeID string, configVersion int, failures []RuleDeploymentFailureRecord, now string, nextID func() string) error
	DeleteRuleDeploymentForNode(ctx context.Context, organizationID string, ruleID string, nodeID string) error
	DeleteRuleDeployments(ctx context.Context, organizationID string, ruleID string) error
}

type RuleTrafficDeltaRecord added in v0.1.18

type RuleTrafficDeltaRecord struct {
	RuleID         string
	UploadBytes    int64
	DownloadBytes  int64
	TCPConnections int64
	UDPPackets     int64
}

type RuleTrafficRecord

type RuleTrafficRecord struct {
	UploadBytes    int64
	DownloadBytes  int64
	TCPConnections int64
	UDPPackets     int64
}

type RuleTrafficReportRecord added in v0.1.18

type RuleTrafficReportRecord struct {
	ID             string
	OrganizationID string
	AgentID        string
	ReportID       string
	CreatedAt      string
}

type TargetGroupMemberRecord

type TargetGroupMemberRecord struct {
	ID             string
	OrganizationID string
	TargetGroupID  string
	TargetID       string
	Priority       int
	Enabled        bool
	CreatedAt      string
	UpdatedAt      string
}

type TargetGroupRecord

type TargetGroupRecord struct {
	ID             string
	OrganizationID string
	Name           string
	Description    string
	Scheduler      string
	CreatedAt      string
	UpdatedAt      string
	DeletedAt      string
	Members        []TargetGroupMemberRecord
}

type TargetGroupRepository

type TargetGroupRepository interface {
	ListTargetGroupsByOrganization(ctx context.Context, organizationID string) ([]TargetGroupRecord, error)
	FindTargetGroupByID(ctx context.Context, organizationID string, targetGroupID string) (TargetGroupRecord, error)
	CreateTargetGroup(ctx context.Context, targetGroup TargetGroupRecord, members []TargetGroupMemberRecord, now string, nextID func() string) error
	UpdateTargetGroup(ctx context.Context, targetGroup TargetGroupRecord, members []TargetGroupMemberRecord, now string, nextID func() string) error
	DeleteTargetGroup(ctx context.Context, organizationID string, targetGroupID string, deletedAt string) error
}

type TargetRecord

type TargetRecord struct {
	ID             string
	OrganizationID string
	Name           string
	Host           string
	Port           int
	Enabled        bool
	CreatedAt      string
	UpdatedAt      string
	DeletedAt      string
}

type TargetRepository

type TargetRepository interface {
	ListTargetsByOrganization(ctx context.Context, organizationID string) ([]TargetRecord, error)
	FindTargetByID(ctx context.Context, organizationID string, targetID string) (TargetRecord, error)
	CreateTarget(ctx context.Context, target TargetRecord) error
	UpdateTarget(ctx context.Context, target TargetRecord) error
	DeleteTarget(ctx context.Context, organizationID string, targetID string, deletedAt string) error
}

type UnitOfWork

type UnitOfWork interface {
	WithinTx(ctx context.Context, fn func(ctx context.Context, repositories Repositories) error) error
}

type UserRecord

type UserRecord struct {
	ID    string
	Email string
	Name  string
}

type UserRepository

type UserRepository interface {
	FindUserByID(ctx context.Context, userID string) (UserRecord, error)
	FindUserByEmail(ctx context.Context, email string) (UserRecord, error)
}

Jump to

Keyboard shortcuts

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