Documentation
¶
Index ¶
- Variables
- func OpenPostgres(databaseURL string) (*sql.DB, error)
- type AgentCredentialRecord
- type AgentCredentialRepository
- type AgentRegistrationTokenRecord
- type AgentRegistrationTokenRepository
- type AuditLogRecord
- type AuditLogRepository
- type InboundBindingRecord
- type MemberRecord
- type MemberRepository
- type MonitorGroupRecord
- type MonitorGroupRepository
- type MonitorRecord
- type MonitorRepository
- type NodeAgentVersionRecord
- type NodeGroupRecord
- type NodeGroupRepository
- type NodeListenIPRecord
- type NodePortRangeRecord
- type NodeRecord
- type NodeRepository
- type OrganizationRecord
- type OrganizationRepository
- type PostgresStore
- func (store *PostgresStore) ActivateCredential(ctx context.Context, organizationID string, credentialID string, ...) error
- func (store *PostgresStore) AgentCredentials() AgentCredentialRepository
- func (store *PostgresStore) AgentRegistrationTokens() AgentRegistrationTokenRepository
- func (store *PostgresStore) AuditLogs() AuditLogRepository
- func (store *PostgresStore) ClaimRegistrationToken(ctx context.Context, organizationID string, tokenID string, claimedAt string) error
- func (store *PostgresStore) CountOrganizations(ctx context.Context) (int, error)
- func (store *PostgresStore) CountRulesByOrganization(ctx context.Context, organizationID string) (int, error)
- func (store *PostgresStore) CountRulesByOwner(ctx context.Context, organizationID string, ownerUserID string) (int, error)
- func (store *PostgresStore) CreateAuditLog(ctx context.Context, audit AuditLogRecord) error
- func (store *PostgresStore) CreateCredential(ctx context.Context, credential AgentCredentialRecord) error
- func (store *PostgresStore) CreateMember(ctx context.Context, member MemberRecord) error
- func (store *PostgresStore) CreateMonitor(ctx context.Context, monitor MonitorRecord, groupIDs []string, now string, ...) error
- func (store *PostgresStore) CreateMonitorGroup(ctx context.Context, monitorGroup MonitorGroupRecord) error
- func (store *PostgresStore) CreateNode(ctx context.Context, node NodeRecord, groupIDs []string, ...) error
- func (store *PostgresStore) CreateNodeGroup(ctx context.Context, nodeGroup NodeGroupRecord) error
- func (store *PostgresStore) CreateOrganization(ctx context.Context, organization OrganizationRecord) error
- func (store *PostgresStore) CreateRegistrationToken(ctx context.Context, token AgentRegistrationTokenRecord) error
- func (store *PostgresStore) CreateRole(ctx context.Context, role RoleRecord) error
- func (store *PostgresStore) CreateRule(ctx context.Context, rule RuleRecord, binding InboundBindingRecord, ...) error
- func (store *PostgresStore) CreateTarget(ctx context.Context, target TargetRecord) error
- func (store *PostgresStore) CreateTargetGroup(ctx context.Context, targetGroup TargetGroupRecord, ...) error
- func (store *PostgresStore) DeleteMember(ctx context.Context, organizationID string, memberID string) error
- func (store *PostgresStore) DeleteMonitor(ctx context.Context, organizationID string, monitorID string, deletedAt string) error
- func (store *PostgresStore) DeleteMonitorGroup(ctx context.Context, organizationID string, monitorGroupID string, ...) error
- func (store *PostgresStore) DeleteNode(ctx context.Context, organizationID string, nodeID string, deletedAt string) error
- func (store *PostgresStore) DeleteNodeGroup(ctx context.Context, organizationID string, nodeGroupID string, ...) error
- func (store *PostgresStore) DeleteRole(ctx context.Context, organizationID string, roleID string) error
- func (store *PostgresStore) DeleteRule(ctx context.Context, organizationID string, ruleID string, deletedAt string) error
- func (store *PostgresStore) DeleteTarget(ctx context.Context, organizationID string, targetID string, deletedAt string) error
- func (store *PostgresStore) DeleteTargetGroup(ctx context.Context, organizationID string, targetGroupID string, ...) error
- func (store *PostgresStore) EnsureDesiredConfigVersionAtLeast(ctx context.Context, organizationID string, nodeID string, configVersion int, ...) error
- func (store *PostgresStore) FindCredentialByHash(ctx context.Context, credentialHash string) (AgentCredentialRecord, error)
- func (store *PostgresStore) FindMemberByUserAndOrganization(ctx context.Context, organizationID string, userID string) (MemberRecord, error)
- func (store *PostgresStore) FindMonitorByID(ctx context.Context, organizationID string, monitorID string) (MonitorRecord, error)
- func (store *PostgresStore) FindMonitorGroupByID(ctx context.Context, organizationID string, monitorGroupID string) (MonitorGroupRecord, error)
- func (store *PostgresStore) FindNodeByID(ctx context.Context, organizationID string, nodeID string) (NodeRecord, error)
- func (store *PostgresStore) FindNodeGroupByID(ctx context.Context, organizationID string, nodeGroupID string) (NodeGroupRecord, error)
- func (store *PostgresStore) FindOrganizationByID(ctx context.Context, organizationID string) (OrganizationRecord, error)
- func (store *PostgresStore) FindPendingCredentialByRegistrationToken(ctx context.Context, organizationID string, registrationTokenID string) (AgentCredentialRecord, error)
- func (store *PostgresStore) FindRegistrationTokenByHash(ctx context.Context, tokenHash string) (AgentRegistrationTokenRecord, error)
- func (store *PostgresStore) FindRoleByID(ctx context.Context, organizationID string, roleID string) (RoleRecord, error)
- func (store *PostgresStore) FindRuleByID(ctx context.Context, organizationID string, ruleID string) (RuleRecord, error)
- func (store *PostgresStore) FindTargetByID(ctx context.Context, organizationID string, targetID string) (TargetRecord, error)
- func (store *PostgresStore) FindTargetGroupByID(ctx context.Context, organizationID string, targetGroupID string) (TargetGroupRecord, error)
- func (store *PostgresStore) FindUserByEmail(ctx context.Context, email string) (UserRecord, error)
- func (store *PostgresStore) FindUserByID(ctx context.Context, userID string) (UserRecord, error)
- func (store *PostgresStore) IncrementDesiredConfigForNode(ctx context.Context, organizationID string, nodeID string, now string) error
- func (store *PostgresStore) IncrementDesiredConfigForNodeGroup(ctx context.Context, organizationID string, nodeGroupID string, now string) error
- func (store *PostgresStore) ListEnabledInboundBindings(ctx context.Context, organizationID string) ([]RuleRecord, error)
- func (store *PostgresStore) ListForMember(ctx context.Context, organizationID string, memberID string) ([]RoleRecord, error)
- func (store *PostgresStore) ListMembersByOrganization(ctx context.Context, organizationID string) ([]MemberRecord, error)
- func (store *PostgresStore) ListMonitorGroupsByOrganization(ctx context.Context, organizationID string) ([]MonitorGroupRecord, error)
- func (store *PostgresStore) ListMonitorsByOrganization(ctx context.Context, organizationID string) ([]MonitorRecord, error)
- func (store *PostgresStore) ListNodeGroupsByOrganization(ctx context.Context, organizationID string) ([]NodeGroupRecord, error)
- func (store *PostgresStore) ListNodesByOrganization(ctx context.Context, organizationID string) ([]NodeRecord, error)
- func (store *PostgresStore) ListOrganizations(ctx context.Context) ([]OrganizationRecord, error)
- func (store *PostgresStore) ListOrganizationsByUserID(ctx context.Context, userID string) ([]OrganizationRecord, error)
- func (store *PostgresStore) ListQuotasByOrganization(ctx context.Context, organizationID string) ([]QuotaRecord, error)
- func (store *PostgresStore) ListRegistrationTokens(ctx context.Context, organizationID string, agentType string, agentID string) ([]AgentRegistrationTokenRecord, error)
- func (store *PostgresStore) ListRolesByOrganization(ctx context.Context, organizationID string) ([]RoleRecord, error)
- func (store *PostgresStore) ListRulesByOrganization(ctx context.Context, organizationID string) ([]RuleRecord, error)
- func (store *PostgresStore) ListTargetGroupsByOrganization(ctx context.Context, organizationID string) ([]TargetGroupRecord, error)
- func (store *PostgresStore) ListTargetsByOrganization(ctx context.Context, organizationID string) ([]TargetRecord, error)
- func (store *PostgresStore) MarkMonitorAgentConnected(ctx context.Context, organizationID string, monitorID string, now string) error
- func (store *PostgresStore) MarkMonitorAgentDisconnected(ctx context.Context, organizationID string, monitorID string, now string) error
- func (store *PostgresStore) MarkNodeAgentConnected(ctx context.Context, organizationID string, nodeID string, now string) error
- func (store *PostgresStore) MarkNodeAgentDisconnected(ctx context.Context, organizationID string, nodeID string, now string) error
- func (store *PostgresStore) MarkNodeAgentUpdateRequested(ctx context.Context, organizationID string, nodeID string, ...) error
- func (store *PostgresStore) MarkNodeAgentUpdateSatisfied(ctx context.Context, organizationID string, nodeID string, ...) error
- func (store *PostgresStore) Members() MemberRepository
- func (store *PostgresStore) MonitorGroups() MonitorGroupRepository
- func (store *PostgresStore) Monitors() MonitorRepository
- func (store *PostgresStore) NodeGroups() NodeGroupRepository
- func (store *PostgresStore) Nodes() NodeRepository
- func (store *PostgresStore) Organizations() OrganizationRepository
- func (store *PostgresStore) Quotas() QuotaRepository
- func (store *PostgresStore) RecordNodeAgentUpdateResult(ctx context.Context, organizationID string, nodeID string, status string, ...) error
- func (store *PostgresStore) RecordNodeConfigAck(ctx context.Context, organizationID string, nodeID string, configVersion int, ...) error
- func (store *PostgresStore) ReleaseRegistrationTokenUse(ctx context.Context, organizationID string, tokenID string) error
- func (store *PostgresStore) ReplaceMemberRoles(ctx context.Context, organizationID string, memberID string, roleIDs []string, ...) error
- func (store *PostgresStore) ReplacePermissions(ctx context.Context, organizationID string, roleID string, ...) error
- func (store *PostgresStore) ReplaceResourceScopes(ctx context.Context, organizationID string, roleID string, ...) error
- func (store *PostgresStore) RevokeActiveCredentialsExcept(ctx context.Context, organizationID string, agentType string, agentID string, ...) error
- func (store *PostgresStore) RevokeActiveUnusedRegistrationTokens(ctx context.Context, organizationID string, agentType string, agentID string, ...) error
- func (store *PostgresStore) RevokeCredential(ctx context.Context, organizationID string, credentialID string, ...) error
- func (store *PostgresStore) RevokeRegistrationToken(ctx context.Context, organizationID string, agentType string, agentID string, ...) error
- func (store *PostgresStore) Roles() RoleRepository
- func (store *PostgresStore) Rules() RuleRepository
- func (store *PostgresStore) SumRuleTraffic(ctx context.Context, organizationID string, ruleID string) (RuleTrafficRecord, error)
- func (store *PostgresStore) TargetGroups() TargetGroupRepository
- func (store *PostgresStore) Targets() TargetRepository
- func (store *PostgresStore) UpdateMemberStatus(ctx context.Context, organizationID string, memberID string, status string) error
- func (store *PostgresStore) UpdateMonitor(ctx context.Context, monitor MonitorRecord, replaceGroups bool, ...) error
- func (store *PostgresStore) UpdateMonitorGroup(ctx context.Context, monitorGroup MonitorGroupRecord) error
- func (store *PostgresStore) UpdateNode(ctx context.Context, node NodeRecord, replaceGroups bool, groupIDs []string, ...) error
- func (store *PostgresStore) UpdateNodeAgentUpdatePolicy(ctx context.Context, organizationID string, nodeID string, enabled bool, ...) error
- func (store *PostgresStore) UpdateNodeAgentVersion(ctx context.Context, organizationID string, nodeID string, ...) error
- func (store *PostgresStore) UpdateNodeGroup(ctx context.Context, nodeGroup NodeGroupRecord) error
- func (store *PostgresStore) UpdateOrganization(ctx context.Context, organization OrganizationRecord) error
- func (store *PostgresStore) UpdateRole(ctx context.Context, role RoleRecord) error
- func (store *PostgresStore) UpdateRule(ctx context.Context, rule RuleRecord, binding InboundBindingRecord, ...) error
- func (store *PostgresStore) UpdateTarget(ctx context.Context, target TargetRecord) error
- func (store *PostgresStore) UpdateTargetGroup(ctx context.Context, targetGroup TargetGroupRecord, ...) error
- func (store *PostgresStore) Users() UserRepository
- func (store *PostgresStore) WithinTx(ctx context.Context, ...) error
- type QuotaRecord
- type QuotaRepository
- type Repositories
- type ResourceScopeRecord
- type RoleRecord
- type RoleRepository
- type RuleRecord
- type RuleRepository
- type RuleTrafficRecord
- type TargetGroupMemberRecord
- type TargetGroupRecord
- type TargetGroupRepository
- type TargetRecord
- type TargetRepository
- type UnitOfWork
- type UserRecord
- type UserRepository
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 ¶
Types ¶
type AgentCredentialRecord ¶
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 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 AuditLogRepository ¶
type AuditLogRepository interface {
CreateAuditLog(ctx context.Context, audit AuditLogRecord) error
}
type InboundBindingRecord ¶
type MemberRecord ¶
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 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 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
DeleteMonitor(ctx context.Context, organizationID string, monitorID string, deletedAt string) error
}
type NodeAgentVersionRecord ¶
type NodeGroupRecord ¶
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 NodePortRangeRecord ¶
type NodeRecord ¶
type NodeRecord struct {
ID string
OrganizationID string
Name string
Status string
PublicDescription string
DesiredConfigVersion int
AppliedConfigVersion int
ConfigStatus string
ConfigErrorMessage 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
}
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, configVersion int, status string, errorMessage string, 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 OrganizationRecord ¶
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 (*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 (*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 (*PostgresStore) CountRulesByOwner ¶ added in v0.1.16
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) 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) 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) DeleteMember ¶ added in v0.1.16
func (*PostgresStore) DeleteMonitor ¶ added in v0.1.16
func (*PostgresStore) DeleteMonitorGroup ¶ added in v0.1.16
func (*PostgresStore) DeleteNode ¶ added in v0.1.16
func (*PostgresStore) DeleteNodeGroup ¶ added in v0.1.16
func (*PostgresStore) DeleteRole ¶ added in v0.1.16
func (*PostgresStore) DeleteRule ¶ added in v0.1.16
func (*PostgresStore) DeleteTarget ¶ added in v0.1.16
func (*PostgresStore) DeleteTargetGroup ¶ added in v0.1.16
func (*PostgresStore) EnsureDesiredConfigVersionAtLeast ¶ added in v0.1.16
func (*PostgresStore) FindCredentialByHash ¶ added in v0.1.16
func (store *PostgresStore) FindCredentialByHash(ctx context.Context, credentialHash string) (AgentCredentialRecord, 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) 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) IncrementDesiredConfigForNode ¶ added in v0.1.16
func (*PostgresStore) IncrementDesiredConfigForNodeGroup ¶ added in v0.1.16
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) 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) 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) 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) 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) MarkMonitorAgentConnected ¶ added in v0.1.16
func (*PostgresStore) MarkMonitorAgentDisconnected ¶ added in v0.1.16
func (*PostgresStore) MarkNodeAgentConnected ¶ added in v0.1.16
func (*PostgresStore) MarkNodeAgentDisconnected ¶ added in v0.1.16
func (*PostgresStore) MarkNodeAgentUpdateRequested ¶ added in v0.1.16
func (*PostgresStore) MarkNodeAgentUpdateSatisfied ¶ added in v0.1.16
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) RecordNodeAgentUpdateResult ¶ added in v0.1.16
func (*PostgresStore) RecordNodeConfigAck ¶ added in v0.1.16
func (*PostgresStore) ReleaseRegistrationTokenUse ¶ added in v0.1.16
func (*PostgresStore) ReplaceMemberRoles ¶ added in v0.1.16
func (*PostgresStore) ReplacePermissions ¶ added in v0.1.16
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) RevokeActiveCredentialsExcept ¶ added in v0.1.16
func (*PostgresStore) RevokeActiveUnusedRegistrationTokens ¶ added in v0.1.16
func (*PostgresStore) RevokeCredential ¶ added in v0.1.16
func (*PostgresStore) RevokeRegistrationToken ¶ added in v0.1.16
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) 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) UpdateMemberStatus ¶ added in v0.1.16
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 (*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) 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) 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 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
Targets() TargetRepository
TargetGroups() TargetGroupRepository
Rules() RuleRepository
Quotas() QuotaRepository
AgentRegistrationTokens() AgentRegistrationTokenRepository
AgentCredentials() AgentCredentialRepository
AuditLogs() AuditLogRepository
}
type ResourceScopeRecord ¶
type RoleRecord ¶
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 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
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)
}
type RuleTrafficRecord ¶
type TargetGroupMemberRecord ¶
type TargetGroupRecord ¶
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 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 UserRecord ¶
type UserRepository ¶
type UserRepository interface {
FindUserByID(ctx context.Context, userID string) (UserRecord, error)
FindUserByEmail(ctx context.Context, email string) (UserRecord, error)
}
Click to show internal directories.
Click to hide internal directories.