realtimedb

package
v0.5.12 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct{}

Client to interact with storage API

func (Client) NewRef

func (i Client) NewRef(path string) *db.Ref

NewRef returns a reference to path in Realtime DB

func (Client) RunTransaction

func (i Client) RunTransaction(ctx context.Context, path string, f db.UpdateFn) (err error)

RunTransaction runs f in a transaction at given path in Realtime DB

type MockClient

type MockClient struct{}

MockClient mocks storage client functionality for unit tests

func (MockClient) NewRef

func (i MockClient) NewRef(path string) *db.Ref

NewRef returns a reference to path in Realtime DB (it's a mock!)

func (MockClient) RunTransaction

func (i MockClient) RunTransaction(ctx context.Context, path string, f db.UpdateFn) (err error)

RunTransaction runs f in a transaction (but not, because it's a mock)

type RealtimeDB

type RealtimeDB interface {
	NewRef(path string) *db.Ref
	RunTransaction(ctx context.Context, path string, f db.UpdateFn) error
}

RealtimeDB is a Realtime DB abstraction layer interface

Jump to

Keyboard shortcuts

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