Documentation
¶
Index ¶
- Constants
- Variables
- func WrongType(dtype Kind, data string) error
- type Complex
- type CreatedBy
- type CreationMode
- type DimMismatchError
- type File
- type FileWithPar
- type GetterMaker
- type GetterPool
- type IntMeta
- type Kind
- type Like
- type Loader
- func (l Loader) LoadFile(p PathWithPar, mp MetaParser) (f File, err error)
- func (l Loader) MetaFromFile(path string, mp MetaParser) (m Meta, err error)
- func (l Loader) OpenParamGetter(path string, fn UseParamFunc) (err error)
- func (l Loader) ParseMeta(r io.Reader, mp MetaParser) (m Meta, err error)
- func (l Loader) WithParamGetter(r io.Reader, fn UseParamFunc) (err error)
- type Meta
- type MetaParser
- type MetaValidator
- type ParamKeys
- type Parameter
- type ParseAndValidate
- type ParserWithGetter
- func (p ParserWithGetter) ParseFloat(key string, size bit.Size) (fl float64, err error)
- func (p ParserWithGetter) ParseInt(key string, base bit.Base, size bit.Size) (ii int64, err error)
- func (p ParserWithGetter) ParseUint(key string, base bit.Base, size bit.Size) (ui uint64, err error)
- func (p ParserWithGetter) ParseVar(key string, v Var) (err error)
- type Path
- type PathWithPar
- type Real
- type RngAzi
- func (r RngAzi) MustSameCols(other RngAzi) (err error)
- func (r RngAzi) MustSameRows(other RngAzi) (err error)
- func (r RngAzi) MustSameShape(other RngAzi) (err error)
- func (r RngAzi) SameCols(other RngAzi) (b bool)
- func (r RngAzi) SameRows(other RngAzi) (b bool)
- func (r RngAzi) SameShape(other RngAzi) (b bool)
- type ShapeMismatchError
- type TypeEnsurer
- type TypeMismatchError
- type UnknownTypeError
- type UseParamFunc
- type Var
- type WrongTypeError
Constants ¶
View Source
const DateFmt date.ParseFmt = "2016 12 05"
Variables ¶
View Source
var ( EnsureComplex = NewTypeEnsurer(KindShortCpx, KindFloatCpx) EnsureReal = NewTypeEnsurer(KindFloat, KindDouble) )
View Source
var DateParse = date.Format("2016 12 05").Ref(date.DefaultFormatParser)
View Source
var DefaultKeys = ParamKeys{
Range: "range_samples",
Azimuth: "azimuth_lines",
Type: "image_format",
Date: "date",
}
Functions ¶
Types ¶
type Complex ¶
type Complex struct {
File
}
func LoadComplex ¶
func LoadComplex(l Loader, p PathWithPar) (c Complex, err error)
type CreatedBy ¶
type CreatedBy struct { Mode CreationMode `json:"mode"` Cmd string `json:"command"` }
func CreationUnknown ¶
func CreationUnknown() (c CreatedBy)
func (*CreatedBy) MarshalJSON ¶
func (*CreatedBy) UnmarshalJSON ¶
type CreationMode ¶
type CreationMode int
const ( CreationNone CreationMode = iota CreationCommand )
func (CreationMode) Some ¶
func (c CreationMode) Some() (b bool)
type DimMismatchError ¶
type DimMismatchError struct {
One, Two RngAzi
}
func (DimMismatchError) Error ¶
func (d DimMismatchError) Error() (s string)
type File ¶
func LoadAndValidate ¶
func LoadAndValidate(l Loader, p PathWithPar, pk ParamKeys, v MetaValidator) (f File, err error)
func LoadDefault ¶
func LoadDefault(l Loader, p PathWithPar, v MetaValidator) (f File, err error)
func (File) MustSameDim ¶
type FileWithPar ¶
type GetterMaker ¶
type GetterPool ¶
type GetterPool struct {
// contains filtered or unexported fields
}
func NewGetterPool ¶
func NewGetterPool() (gp *GetterPool)
func (*GetterPool) MakeGetter ¶
func (m *GetterPool) MakeGetter() (mg parser.MutGetter)
func (*GetterPool) PutGetter ¶
func (m *GetterPool) PutGetter(mg parser.MutGetter)
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
func DefaultLoader ¶
func DefaultLoader() (l Loader)
func (Loader) LoadFile ¶
func (l Loader) LoadFile(p PathWithPar, mp MetaParser) (f File, err error)
func (Loader) MetaFromFile ¶
func (l Loader) MetaFromFile(path string, mp MetaParser) (m Meta, err error)
func (Loader) OpenParamGetter ¶
func (l Loader) OpenParamGetter(path string, fn UseParamFunc) (err error)
func (Loader) WithParamGetter ¶
func (l Loader) WithParamGetter(r io.Reader, fn UseParamFunc) (err error)
type Meta ¶
type Meta struct { DataType Kind `json:"data_type"` RngAzi RngAzi `json:"range_azimuth"` Date date.Date `json:"date"` CreatedBy CreatedBy `json:"created_by"` }
func (Meta) MustBeComplex ¶
func (Meta) MustBeOfType ¶
func (Meta) MustBeReal ¶
type MetaParser ¶
type MetaValidator ¶
type ParamKeys ¶
type ParamKeys struct { Range string `json:"range"` Azimuth string `json:"azimuth"` Type string `json:"type"` Date string `json:"date"` }
ParamKeys holds the keys for different fields for Meta.
type Parameter ¶
func (*Parameter) SetParFile ¶
type ParseAndValidate ¶
type ParseAndValidate struct {
// contains filtered or unexported fields
}
type ParserWithGetter ¶
type ParserWithGetter struct {
// contains filtered or unexported fields
}
func WithGetter ¶
func WithGetter(p parser.Parser, g parser.Getter) (pg ParserWithGetter)
func (ParserWithGetter) ParseFloat ¶
type Path ¶
type Path struct {
DataFile string
}
func (Path) MarshalJSON ¶
func (*Path) UnmarshalJSON ¶
func (Path) WithParFile ¶
func (p Path) WithParFile(file string) (pp PathWithPar)
type PathWithPar ¶
func (PathWithPar) WithPar ¶
func (p PathWithPar) WithPar(file string) (pp PathWithPar)
type RngAzi ¶
func (RngAzi) MustSameCols ¶
func (RngAzi) MustSameRows ¶
func (RngAzi) MustSameShape ¶
type ShapeMismatchError ¶
func (ShapeMismatchError) Error ¶
func (s ShapeMismatchError) Error() string
type TypeEnsurer ¶
type TypeEnsurer struct {
// contains filtered or unexported fields
}
func NewTypeEnsurer ¶
func NewTypeEnsurer(dtypes ...Kind) (t TypeEnsurer)
func (TypeEnsurer) ValidateMeta ¶
func (t TypeEnsurer) ValidateMeta(m Meta) (err error)
type TypeMismatchError ¶
type TypeMismatchError struct { Expected string Got Kind // contains filtered or unexported fields }
func (TypeMismatchError) Error ¶
func (e TypeMismatchError) Error() string
func (TypeMismatchError) Unwrap ¶
func (e TypeMismatchError) Unwrap() error
type UnknownTypeError ¶
func (UnknownTypeError) Error ¶
func (e UnknownTypeError) Error() string
func (UnknownTypeError) Unwrap ¶
func (e UnknownTypeError) Unwrap() error
type UseParamFunc ¶
type WrongTypeError ¶
type WrongTypeError struct { Kind // contains filtered or unexported fields }
func (WrongTypeError) Error ¶
func (e WrongTypeError) Error() string
func (WrongTypeError) Unwrap ¶
func (e WrongTypeError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.