postgres

package
v0.12.3-alpha.6 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type ActivityRepository

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

func NewActivityRepository

func NewActivityRepository(db *gorm.DB) *ActivityRepository

func (*ActivityRepository) BulkUpsert

func (r *ActivityRepository) BulkUpsert(ctx context.Context, activities []*domain.Activity) error

func (*ActivityRepository) Find

func (*ActivityRepository) GetOne

func (r *ActivityRepository) GetOne(ctx context.Context, id string) (*domain.Activity, error)

type AppealRepository

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

AppealRepository talks to the store to read or insert data

func NewAppealRepository

func NewAppealRepository(db *gorm.DB) *AppealRepository

NewAppealRepository returns repository struct

func (*AppealRepository) BulkUpsert

func (r *AppealRepository) BulkUpsert(ctx context.Context, appeals []*domain.Appeal) error

BulkUpsert new record to database

func (*AppealRepository) Find

func (*AppealRepository) GetAppealsTotalCount added in v0.7.5

func (r *AppealRepository) GetAppealsTotalCount(ctx context.Context, filter *domain.ListAppealsFilter) (int64, error)

func (*AppealRepository) GetByID

func (r *AppealRepository) GetByID(ctx context.Context, id string) (*domain.Appeal, error)

GetByID returns appeal record by id along with the approvals and the approvers

func (*AppealRepository) Update

func (r *AppealRepository) Update(ctx context.Context, a *domain.Appeal) error

Update an approval step

func (*AppealRepository) UpdateByID added in v0.11.0

func (r *AppealRepository) UpdateByID(ctx context.Context, a *domain.Appeal) error

type ApprovalRepository

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

func NewApprovalRepository

func NewApprovalRepository(db *gorm.DB) *ApprovalRepository

func (*ApprovalRepository) AddApprover

func (r *ApprovalRepository) AddApprover(ctx context.Context, approver *domain.Approver) error

func (*ApprovalRepository) BulkInsert

func (r *ApprovalRepository) BulkInsert(ctx context.Context, approvals []*domain.Approval) error

func (*ApprovalRepository) DeleteApprover

func (r *ApprovalRepository) DeleteApprover(ctx context.Context, approvalID, email string) error

func (*ApprovalRepository) GetApprovalsTotalCount added in v0.7.5

func (r *ApprovalRepository) GetApprovalsTotalCount(ctx context.Context, filter *domain.ListApprovalsFilter) (int64, error)

func (*ApprovalRepository) ListApprovals

func (r *ApprovalRepository) ListApprovals(ctx context.Context, filter *domain.ListApprovalsFilter) ([]*domain.Approval, error)

type AuditLogRepository added in v0.11.0

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

TODO: merge into github.com/goto/salt/audit

func NewAuditLogRepository added in v0.11.0

func NewAuditLogRepository(db *gorm.DB) *AuditLogRepository

func (*AuditLogRepository) List added in v0.11.0

type CommentRepository added in v0.10.0

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

func NewCommentRepository added in v0.10.0

func NewCommentRepository(db *gorm.DB) *CommentRepository

func (*CommentRepository) Create added in v0.10.0

func (r *CommentRepository) Create(ctx context.Context, c *domain.Comment) error

func (*CommentRepository) List added in v0.10.0

type GrantRepository

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

func NewGrantRepository

func NewGrantRepository(db *gorm.DB) *GrantRepository

func (*GrantRepository) BulkInsert

func (r *GrantRepository) BulkInsert(ctx context.Context, grants []*domain.Grant) error

func (*GrantRepository) BulkUpsert

func (r *GrantRepository) BulkUpsert(ctx context.Context, grants []*domain.Grant) error

func (*GrantRepository) GetByID

func (r *GrantRepository) GetByID(ctx context.Context, id string) (*domain.Grant, error)

func (*GrantRepository) GetGrantsTotalCount added in v0.7.5

func (r *GrantRepository) GetGrantsTotalCount(ctx context.Context, filter domain.ListGrantsFilter) (int64, error)

func (*GrantRepository) List

func (*GrantRepository) ListUserRoles added in v0.7.6

func (r *GrantRepository) ListUserRoles(ctx context.Context, id string) ([]string, error)

func (*GrantRepository) Patch added in v0.12.2

func (*GrantRepository) Update

func (r *GrantRepository) Update(ctx context.Context, a *domain.Grant) error

type PolicyRepository

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

PolicyRepository talks to the store to read or insert data

func NewPolicyRepository

func NewPolicyRepository(db *gorm.DB) *PolicyRepository

NewPolicyRepository returns repository struct

func (*PolicyRepository) Create

func (r *PolicyRepository) Create(ctx context.Context, p *domain.Policy) error

Create new record to database

func (*PolicyRepository) Find

func (r *PolicyRepository) Find(ctx context.Context) ([]*domain.Policy, error)

Find records based on filters

func (*PolicyRepository) GetOne

func (r *PolicyRepository) GetOne(ctx context.Context, id string, version uint) (*domain.Policy, error)

GetOne returns a policy record based on the id and version params. If version is 0, the latest version will be returned

type ProviderRepository

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

ProviderRepository talks to the store to read or insert data

func NewProviderRepository

func NewProviderRepository(db *gorm.DB) *ProviderRepository

NewProviderRepository returns repository struct

func (*ProviderRepository) Create

Create new record to database

func (*ProviderRepository) Delete

func (r *ProviderRepository) Delete(ctx context.Context, id string) error

Delete record by ID

func (*ProviderRepository) Find

Find records based on filters

func (*ProviderRepository) GetByID

func (r *ProviderRepository) GetByID(ctx context.Context, id string) (*domain.Provider, error)

GetByID record by ID

func (*ProviderRepository) GetOne

func (r *ProviderRepository) GetOne(ctx context.Context, pType, urn string) (*domain.Provider, error)

GetOne returns provider by type and urn

func (*ProviderRepository) GetTypes

func (*ProviderRepository) Update

Update record by ID

type ResourceRepository

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

ResourceRepository talks to the store/database to read/insert data

func NewResourceRepository

func NewResourceRepository(db *gorm.DB) *ResourceRepository

NewResourceRepository returns *Repository

func (*ResourceRepository) BatchDelete

func (r *ResourceRepository) BatchDelete(ctx context.Context, ids []string) error

func (*ResourceRepository) BulkUpsert

func (r *ResourceRepository) BulkUpsert(ctx context.Context, resources []*domain.Resource) error

BulkUpsert inserts records if the records are not exist, or updates the records if they are already exist

func (*ResourceRepository) Delete

func (r *ResourceRepository) Delete(ctx context.Context, id string) error

func (*ResourceRepository) Find

Find records based on filters

func (*ResourceRepository) GetOne

func (r *ResourceRepository) GetOne(ctx context.Context, id string) (*domain.Resource, error)

GetOne record by ID

func (*ResourceRepository) GetResourcesTotalCount added in v0.7.7

func (r *ResourceRepository) GetResourcesTotalCount(ctx context.Context, filter domain.ListResourcesFilter) (int64, error)

func (*ResourceRepository) Update

func (r *ResourceRepository) Update(ctx context.Context, res *domain.Resource) error

Update record by ID

type Store

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

func NewStore

func NewStore(c *store.Config) (*Store, error)

func (*Store) DB

func (s *Store) DB() *gorm.DB

func (*Store) Migrate

func (s *Store) Migrate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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