service

package
v0.0.0-...-17ece98 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Forma

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

Forma is the primary application service.

func New

func New(cnf config.ServiceConfig, storage Storage, tracker Tracker) *Forma

New returns a new instance of the Forma service. It can raise the panic if base URL is invalid or HTML templates are not available.

func (*Forma) HandleGetV1

func (service *Forma) HandleGetV1(ctx context.Context, req v1.GetRequest) (resp v1.GetResponse)

HandleGetV1 handles an input request. Deprecated: TODO issue#version3.0 use SchemaEditor and gRPC gateway instead

func (*Forma) HandleInput

func (service *Forma) HandleInput(ctx context.Context, req v1.PostRequest) (resp v1.PostResponse)

HandleInput handles an input request.

type Storage

type Storage interface {
	// Schema returns the form schema with provided ID.
	Schema(context.Context, domain.ID) (domain.Schema, error)
	// Template returns the form template with provided ID.
	Template(context.Context, domain.ID) (domain.Template, error)
	// StoreInput stores an user input data.
	StoreInput(context.Context, domain.ID, domain.InputData) (*types.Input, error)
}

Storage TODO issue#173

type Tracker

type Tracker interface {
	// LogInput stores an input event.
	LogInput(context.Context, domain.InputEvent) error
}

Tracker TODO issue#173

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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