store

package
v0.0.0-...-0f07f94 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("bingo: not found")

Functions

func IsDID

func IsDID(handleOrDid string) bool

Types

type Entry

type Entry struct {
	Handle          string    `json:"handle"`
	Did             string    `json:"did"`
	IsValid         bool      `json:"valid"`
	LastCheckedTime time.Time `json:"checked"`
}

type Store

type Store struct {
	RedisPrefix string
	Redis       *redis.Client
	DB          *sql.DB
	Queries     *store_queries.Queries
}

func NewStore

func NewStore(
	ctx context.Context,
	client *redis.Client,
	prefix string,
	postgresConnect string,
) (*Store, error)

func (*Store) BulkLookupByDid

func (s *Store) BulkLookupByDid(ctx context.Context, dids []string) ([]*Entry, error)

func (*Store) BulkLookupByHandle

func (s *Store) BulkLookupByHandle(ctx context.Context, handles []string) ([]*Entry, error)

func (*Store) BulkUpdateEntryValidation

func (s *Store) BulkUpdateEntryValidation(ctx context.Context, entries []*Entry) error

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, did string) error

func (*Store) Lookup

func (s *Store) Lookup(ctx context.Context, handleOrDid string) (*Entry, error)

func (*Store) Update

func (s *Store) Update(ctx context.Context, entry *Entry) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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