formly

package module
v0.0.0-...-f416221 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 8 Imported by: 0

README

formly

Is a CLI application for setting up basic forms on the terminal. Feedback on the code or usage of the app is appreciated and can be sent to pablothedeveloper@gmail.com.

Demo

asciicast

Installation

w/ Golang:
go get -u github.com/pablothedeveloper/formly/cmd/form

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidLengthName error = errors.New("name's length is not between 1 - 16 characters long")

ErrInvalidLengthName ...

View Source
var ErrInvalidLengthUsage error = errors.New("name's length is not between 5 - 252 characters long")

ErrInvalidLengthUsage ...

View Source
var ErrNameIsNotAWord error = errors.New("name is not composed only of letters")

ErrNameIsNotAWord ...

Functions

func ValidateName

func ValidateName(name string) error

ValidateName ...

func ValidateUsage

func ValidateUsage(usage string) error

ValidateUsage ...

Types

type Entry

type Entry struct {
	ID, LabelID, SubmissionID int64
	Txt                       string
}

Entry ...

type EntryModel

type EntryModel interface {
	Create(submissionID, labelID int64, txt string) (Entry, error)
	GetEntries(submissionID, labeID int64) ([]Entry, error)
}

EntryModel ...

type Env

type Env struct {
	FormModel
	LabelModel
	SubmissionModel
	EntryModel
	// contains filtered or unexported fields
}

Env ...

func NewLocalSqLiteEnv

func NewLocalSqLiteEnv() (*Env, error)

NewLocalSqLiteEnv ...

func (*Env) Close

func (env *Env) Close() error

Close ...

type Form

type Form struct {
	ID          int64
	Name, Usage string
}

Form ...

type FormModel

type FormModel interface {
	Create(name, usage string) (Form, error)
	GetByName(name string) (Form, error)
	GetByID(id int64) (Form, error)
	GetAll() ([]Form, error)
	DeleteByID(id int64) (Form, error)
	DeleteByName(name string) (Form, error)
	Update(formID int64, name, usage string) (Form, error)
}

FormModel ...

type Label

type Label struct {
	ID, FormID, Position int64
	Repeatable           bool
	Name, Usage          string
}

Label ...

type LabelModel

type LabelModel interface {
	Create(formID, position int64, repeatable bool, name, usage string) (Label, error)
	GetLabels(formID int64) ([]Label, error)
	Update(formID, labelID, position int64, repeatable bool, name, usage string) ([]Label, error)
	DeleteByID(id int64) (Label, error)
}

LabelModel ...

type Submission

type Submission struct {
	ID, FormID int64
	CreateAt   time.Time
}

Submission ...

type SubmissionModel

type SubmissionModel interface {
	Create(formID int64) (Submission, error)
	GetSubmissions(formID int64) ([]Submission, error)
}

SubmissionModel ...

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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