storage

package
v0.0.0-...-724a60f Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FirestoreAdapter

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

FirestoreAdapter implements storer in firestore

func (*FirestoreAdapter) AddPostID

func (fa *FirestoreAdapter) AddPostID(id string)

AddPostID creates a new empty file. Name of the file is an id

func (*FirestoreAdapter) IsPostIDExists

func (fa *FirestoreAdapter) IsPostIDExists(id string) bool

IsPostIDExists lists all the objects in the bucket and checks if object with name id exists

type GcsAdapter

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

GcsAdapter implements storer in google cloud storage

func (*GcsAdapter) AddPostID

func (s *GcsAdapter) AddPostID(id string)

AddPostID creates a new empty file. Name of the file is an id

func (*GcsAdapter) IsPostIDExists

func (s *GcsAdapter) IsPostIDExists(id string) bool

IsPostIDExists lists all the objects in the bucket and checks if object with name id exists

type PostStorer

type PostStorer interface {
	IsPostIDExists(id string) bool
	AddPostID(id string)
}

PostStorer to store posts

func NewFirestoreAdapter

func NewFirestoreAdapter(collectionName string, projectName string) PostStorer

NewFirestoreAdapter constructor

func NewGcsAdapter

func NewGcsAdapter(bucketName string) PostStorer

NewGcsAdapter creates a new instance. Accepts bucket name for bucket handle

Jump to

Keyboard shortcuts

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