parameters

package
v0.0.0-...-854da8c Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("Not found")
)

Error for parameters

Functions

This section is empty.

Types

type CollectionRepositoryParams

type CollectionRepositoryParams interface {
	Get() []Parameter
}

A CollectionRepositoryParams returns collection of the parameters

type Parameter

type Parameter struct {
	ID          int
	Name        string
	Value       string
	Description string
}

A Parameter store value by name

func MustParameter

func MustParameter(name, value, description string) Parameter

MustParameter returns a new parameter

func (Parameter) Bool

func (p Parameter) Bool() bool

Bool returns value as boolean cast from string value

func (Parameter) IsPreDefined

func (p Parameter) IsPreDefined() bool

IsPreDefined returns true if the parameter a pre-defined

func (Parameter) String

func (p Parameter) String() string

String this stringer

func (Parameter) ValueStr

func (p Parameter) ValueStr() string

ValueStr get Parameter.Value, but return "(empty)" if value is null or empty

type RepositoryParams

type RepositoryParams interface {
	Add(p Parameter) error
	Update(p Parameter) error
	FindByName(name string) (Parameter, error)
	Delete(p Parameter) error
	//Refresh(p *Parameter) error
	Close() error
	All() (CollectionRepositoryParams, error)
}

A RepositoryParams repository for entities of the parameters

func GetInstance

func GetInstance() RepositoryParams

GetInstance create repository of parameters

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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