forms

package
v0.1.61 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package forms is the port of the store of the scans of the forms of a parent's consent (R52; R116 spec): the closed bucket of the operator in Cloud Storage, where api writes under a prefix of its own and reads nothing, and a folder outside every git working tree for the dev projects and the first app. The scan never enters the database api (R114 spec).

Index

Constants

This section is empty.

Variables

View Source
var ErrFailed = errors.New("forms: the store failed")

ErrFailed is a store that did not do what it was asked.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	Client *http.Client
	Base   string
	Name   string
	Prefix string
}

Bucket is the store of a bucket of Cloud Storage, through its JSON API, with the service's own account: client carries its token — one of golang.org/x/oauth2/google's — and base is the API's root, its public one by default. Its objects are named by the prefix and the scan's name. The account may create and erase objects there and read none (R116 spec).

func (Bucket) Delete

func (b Bucket) Delete(ctx context.Context, object string) error

Delete erases the object of the scan; one not there is erased already.

func (Bucket) Put

func (b Bucket) Put(ctx context.Context, object string, scan []byte, mediaType string) error

Put uploads the scan as an object of the bucket, in one request, in the place of one before.

type Dir

type Dir string

Dir is the store of a folder: a file a scan, under its name.

func (Dir) Delete

func (d Dir) Delete(_ context.Context, object string) error

Delete removes the file of the scan; one not there is erased already.

func (Dir) Put

func (d Dir) Put(_ context.Context, object string, scan []byte, _ string) error

Put writes the scan as the file of its name, in the place of one before.

type Store

type Store interface {
	Put(ctx context.Context, object string, scan []byte, mediaType string) error
	Delete(ctx context.Context, object string) error
}

Store is where the scans lie, by the name of each: api creates a scan, a new one in the place of the one before, and erases it, and never reads it back.

Jump to

Keyboard shortcuts

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