submissions

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// The database table name for form submissions.
	TableName = "form_submissions"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository interface {
	Find(formID int) (domain.FormSubmissions, error)
	Create(f domain.FormSubmission) error
	Delete(formID int) error
}

Repository defines methods for form submissions to interact with the database.

type Store

type Store struct {
	*config.Config
}

Store defines the data layer for form submissions.

func New

func New(cfg *config.Config) *Store

New

Creates a new meta store.

func (*Store) Create

func (s *Store) Create(f domain.FormSubmission) error

Create

Returns nil if the submission was successfully created. Returns errors.INTERNAL if the SQL query was invalid.

func (*Store) Delete

func (s *Store) Delete(formID int) error

Delete

Returns nil if the form submissions were successfully deleted. Returns errors.INTERNAL if the SQL query was invalid. Returns errors.NOTFOUND if the form submission was not found.

func (*Store) Find

func (s *Store) Find(formID int) (domain.FormSubmissions, error)

Find

Returns a form submission belonging to a form. Returns errors.INTERNAL if the SQL query was invalid. Returns errors.NOTFOUND if there was none found with the form ID available.

Jump to

Keyboard shortcuts

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