cache

package
v0.0.0-...-2853fc3 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchAsync

func FetchAsync[T any](ctx context.Context, coll *Collection, f func() ([]T, *github.Response, error)) ([]T, error)

func FetchBatchQuery

func FetchBatchQuery[T any](ctx context.Context, coll *Collection, f func() (map[string]T, error)) ([]T, error)

func FetchMultiple

func FetchMultiple[T any](ctx context.Context, coll *Collection, f func() ([]T, error)) ([]T, error)

func FetchPagination

func FetchPagination[T any](ctx context.Context, coll *Collection, f func() ([]T, *github.Response, error), opts *github.ListOptions) ([]T, error)

func FetchSingle

func FetchSingle[T any](ctx context.Context, coll *Collection, f func() (*T, error)) (*T, error)

Types

type Cache

type Cache struct {
	*mongo.Client
}

func NewCache

func NewCache(config configuration.MongoDB) (*Cache, error)

func (*Cache) Database

func (c *Cache) Database(db string) *Database

type Collection

type Collection struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func (*Collection) Database

func (c *Collection) Database() *Database

func (*Collection) IsBroken

func (c *Collection) IsBroken() bool

func (*Collection) Name

func (c *Collection) Name() string

type Database

type Database struct {
	*mongo.Database
	// contains filtered or unexported fields
}

func (*Database) Collection

func (db *Database) Collection(coll string) *Collection

func (*Database) Name

func (db *Database) Name() string

Jump to

Keyboard shortcuts

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