hotmaze

package module
v0.0.0-...-88a1add Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KB = 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	GCPProjectID string

	BackendBaseURL string

	FirestoreClient *firestore.Client

	TasksClient *cloudtasks.Client

	StorageFileTTL time.Duration

	CloudTasksQueuePath string
}

Server encapsulates the Hot Maze backend.

func (Server) HandlerDownload

func (s Server) HandlerDownload(w http.ResponseWriter, r *http.Request)

HandlerDownload reads file data from Firestore and writes it to w. In worflow D1 it is possible to access this URL before the resource has actually been uploaded. Thus in case of "not found", we retry every 400ms, up to 50s.

func (Server) HandlerForgetFile

func (s Server) HandlerForgetFile(w http.ResponseWriter, r *http.Request)

func (Server) HandlerUpload

func (s Server) HandlerUpload(w http.ResponseWriter, r *http.Request)

func (Server) RegisterHandlers

func (s Server) RegisterHandlers()

RegisterHandlers registers the handlers

func (Server) ScheduleForgetFile

func (s Server) ScheduleForgetFile(ctx context.Context, fileUUID string, nbChunks int) (*taskspb.Task, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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