spanner

package
v0.0.0-...-06a76ff Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteAssignedRoles

func DeleteAssignedRoles(
	_ context.Context,
	db helpers.DBWriter,
	itemIDs ...string,
) error

func GetAssignedRole

func GetAssignedRole(ctx context.Context,
	db helpers.Queryer,
	entityID, roleID, circleID, userID string,
) (model.AssignedRole, bool, error)

func GetAssignedRoles

func GetAssignedRoles(ctx context.Context,
	db helpers.Queryer,
	entityID, circleID, userID string,
) ([]model.AssignedRole, error)

func GetCircleAssignedRoles

func GetCircleAssignedRoles(
	ctx context.Context,
	db helpers.Queryer,
	entityID string,
	circleIDs ...string,
) ([]model.AssignedRole, error)

func GetRole

func GetRole(ctx context.Context, db helpers.RowReader, itemID string) (model.Role, bool, error)

func GetRoles

func GetRoles(ctx context.Context, db helpers.Reader, itemIDs []string) ([]model.Role, error)

func InsertAssignedRole

func InsertAssignedRole(
	_ context.Context,
	db helpers.BufferWriter,
	in model.AssignedRole,
) error

func InsertRole

func InsertRole(_ context.Context, db helpers.BufferWriter, in model.Role) error

func NewSpannerClient

func NewSpannerClient(ctx context.Context, dsn, adcCredPath string) (*spanner.Client, error)

func PartialUpdateRoles

func PartialUpdateRoles(_ context.Context, db helpers.BufferWriter, itemIDs []string, in model.RoleUpdate) error

func UpdateRole

func UpdateRole(_ context.Context, db helpers.BufferWriter, in model.Role) error

Types

type Repo

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

func NewRepo

func NewRepo(ctx context.Context, cfg config.Spanner) (Repo, error)

func NewRepoWithClient

func NewRepoWithClient(cli *spanner.Client) Repo

func (Repo) Close

func (r Repo) Close()

func (Repo) ReadOnlyTx

func (r Repo) ReadOnlyTx(ctx context.Context, f func(context.Context, repo.ReadActions) error) error

func (Repo) ReadWriteTx

func (r Repo) ReadWriteTx(
	ctx context.Context,
	f func(context.Context, repo.ReadWriteActions) error,
) (time.Time, error)

func (Repo) SingleRead

func (r Repo) SingleRead() repo.ReadActions

func (Repo) SingleWrite

func (r Repo) SingleWrite() repo.WriteActions

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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