favorite

package
v0.31.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store allows the lookup and management of Favorites.

func NewStore added in v0.30.0

func NewStore(ctx context.Context, db *sql.DB) (*Store, error)

NewStore will create a DB backend from a sql.DB. An error will be returned if statements fail to prepare.

func (*Store) FindAll

func (s *Store) FindAll(ctx context.Context, userID string, filter []assignment.TargetType) ([]assignment.Target, error)

func (*Store) Set

func (s *Store) Set(ctx context.Context, userID string, tgt assignment.Target) error

Set will store the target as a favorite of the given user. Must be authorized as System or the same user. It is safe to call multiple times.

func (*Store) SetTx added in v0.23.0

func (s *Store) SetTx(ctx context.Context, tx *sql.Tx, userID string, tgt assignment.Target) error

SetTx will store the target as a favorite of the given user. Must be authorized as System or the same user. It is safe to call multiple times.

func (*Store) Unset

func (s *Store) Unset(ctx context.Context, userID string, tgt assignment.Target) error

Unset will remove the target as a favorite of the given user. Must be authorized as System or the same user. It is safe to call multiple times.

Jump to

Keyboard shortcuts

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