firestore

package
v0.0.0-...-01bad0f Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package firestore implements a storage layer with Google cloud firestore.

Index

Constants

View Source
const FirestoreCollection = "links"

FirestoreCollection is the collection (in practice, path prefix) for accessing URL content.

Variables

This section is empty.

Functions

This section is empty.

Types

type Firestore

type Firestore struct {
	Client *firestore.Client
}

Firestore is the implementation of Google Cloud firestore backed storage

func (Firestore) Get

func (fs Firestore) Get(_ context.Context, url *url.URL) (*url.URL, error)

Get fetches a URL from storage

func (Firestore) Owns

func (fs Firestore) Owns(ctx context.Context, u *url.URL) bool

Owns implements the interface validating whether a user actually owns this record.

func (Firestore) Put

func (fs Firestore) Put(ctx context.Context, from *url.URL, to *url.URL) error

Put writes a URL into storage TODO: Write tests for all this.

Jump to

Keyboard shortcuts

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