Documentation ¶
Index ¶
- Variables
- type Builder
- func (b *Builder) Build() (*Dataset, error)
- func (b *Builder) Fields(fields []*Field) *Builder
- func (b *Builder) ID(id id.DatasetID) *Builder
- func (b *Builder) MustBuild() *Dataset
- func (b *Builder) NewID() *Builder
- func (b *Builder) Scene(scene id.SceneID) *Builder
- func (b *Builder) Schema(schema id.DatasetSchemaID) *Builder
- func (b *Builder) Source(source Source) *Builder
- type Dataset
- func (d *Dataset) Field(id id.DatasetSchemaFieldID) *Field
- func (d *Dataset) FieldBySource(source Source) *Field
- func (d *Dataset) FieldByType(t ValueType) *Field
- func (d *Dataset) FieldRef(id *id.DatasetSchemaFieldID) *Field
- func (d *Dataset) Fields() []*Field
- func (d *Dataset) ID() (i id.DatasetID)
- func (d *Dataset) NameField(ds *Schema) *Field
- func (d *Dataset) Scene() (i id.SceneID)
- func (d *Dataset) Schema() (i id.DatasetSchemaID)
- func (d *Dataset) Source() (i Source)
- type DatasetCSVParser
- type Diff
- type Field
- type GraphIterator
- type GraphLoader
- type LatLng
- type LatLngHeight
- type List
- func (l List) DiffBySource(l2 List) Diff
- func (l List) FilterByDatasetSchema(s id.DatasetSchemaID) List
- func (l List) FindDataset(id id.DatasetID) *Dataset
- func (l List) FindDatasetBySource(s Source) *Dataset
- func (l List) First() *Dataset
- func (l List) GraphLoader() GraphLoader
- func (l List) Last() *Dataset
- func (l List) Loader() Loader
- func (l List) Map() Map
- func (l List) ToDatasetIds() []id.DatasetID
- type Loader
- type Map
- type Schema
- func (d *Schema) Dynamic() bool
- func (d *Schema) Field(id id.DatasetSchemaFieldID) *SchemaField
- func (d *Schema) FieldBySource(source Source) *SchemaField
- func (d *Schema) FieldByType(t ValueType) *SchemaField
- func (d *Schema) FieldDiffBySource(d2 *Schema) SchemaFieldDiff
- func (d *Schema) FieldRef(id *id.DatasetSchemaFieldID) *SchemaField
- func (d *Schema) Fields() []*SchemaField
- func (d *Schema) ID() (i id.DatasetSchemaID)
- func (d *Schema) IDRef() *id.DatasetSchemaID
- func (d *Schema) Name() string
- func (u *Schema) Rename(name string)
- func (d *Schema) RepresentativeField() *SchemaField
- func (d *Schema) RepresentativeFieldID() *id.DatasetSchemaFieldID
- func (d *Schema) Scene() (i id.SceneID)
- func (d *Schema) Source() (s Source)
- type SchemaBuilder
- func (b *SchemaBuilder) Build() (*Schema, error)
- func (b *SchemaBuilder) Dynamic(dynamic bool) *SchemaBuilder
- func (b *SchemaBuilder) Fields(fields []*SchemaField) *SchemaBuilder
- func (b *SchemaBuilder) ID(id id.DatasetSchemaID) *SchemaBuilder
- func (b *SchemaBuilder) MustBuild() *Schema
- func (b *SchemaBuilder) Name(name string) *SchemaBuilder
- func (b *SchemaBuilder) NewID() *SchemaBuilder
- func (b *SchemaBuilder) RepresentativeField(representativeField id.DatasetSchemaFieldID) *SchemaBuilder
- func (b *SchemaBuilder) Scene(scene id.SceneID) *SchemaBuilder
- func (b *SchemaBuilder) Source(source Source) *SchemaBuilder
- type SchemaField
- type SchemaFieldBuilder
- func (b *SchemaFieldBuilder) Build() (*SchemaField, error)
- func (b *SchemaFieldBuilder) ID(id id.DatasetSchemaFieldID) *SchemaFieldBuilder
- func (b *SchemaFieldBuilder) MustBuild() *SchemaField
- func (b *SchemaFieldBuilder) Name(name string) *SchemaFieldBuilder
- func (b *SchemaFieldBuilder) NewID() *SchemaFieldBuilder
- func (b *SchemaFieldBuilder) Ref(ref *id.DatasetSchemaID) *SchemaFieldBuilder
- func (b *SchemaFieldBuilder) Source(source Source) *SchemaFieldBuilder
- func (b *SchemaFieldBuilder) Type(dataType ValueType) *SchemaFieldBuilder
- type SchemaFieldDiff
- type SchemaGraphIterator
- type SchemaList
- type SchemaMap
- type Source
- type Value
- func (v *Value) Clone() *Value
- func (v *Value) Interface() interface{}
- func (v *Value) Type() ValueType
- func (v *Value) Value() interface{}
- func (v *Value) ValueBool() *bool
- func (v *Value) ValueLatLng() *LatLng
- func (v *Value) ValueLatLngHeight() *LatLngHeight
- func (v *Value) ValueNumber() *float64
- func (v *Value) ValueRef() *id.ID
- func (v *Value) ValueString() *string
- func (v *Value) ValueURL() *url.URL
- type ValueType
Constants ¶
This section is empty.
Variables ¶
var ( // ErrFailedToParseCSVorTSVFile _ ErrFailedToParseCSVorTSVFile error = errors.New("failed to parse file content") // ErrIncompatibleSchema _ ErrIncompatibleSchema error = errors.New("schema is not compatible with csv") // ErrDuplicatiedNameFields _ ErrDuplicatiedNameFields error = errors.New("failed to parse, name-duplicated fields") )
Functions ¶
This section is empty.
Types ¶
type Dataset ¶
type Dataset struct {
// contains filtered or unexported fields
}
Dataset _
func (*Dataset) FieldBySource ¶
FieldBySource _
type DatasetCSVParser ¶
type DatasetCSVParser struct {
// contains filtered or unexported fields
}
func NewCSVParser ¶
func NewCSVParser(r io.Reader, n string, seperator rune) *DatasetCSVParser
func (*DatasetCSVParser) CheckCompatible ¶
func (p *DatasetCSVParser) CheckCompatible(s *Schema) error
func (*DatasetCSVParser) GuessSchema ¶
func (p *DatasetCSVParser) GuessSchema(sid id.SceneID) error
func (*DatasetCSVParser) Init ¶
func (p *DatasetCSVParser) Init() error
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
Field _
type GraphIterator ¶
type GraphIterator struct {
// contains filtered or unexported fields
}
GraphIterator は、データセットをグラフ探索するためのイテレータです。
func GraphIteratorFrom ¶
func GraphIteratorFrom(root id.DatasetID, depth int) *GraphIterator
GraphIteratorFrom _
type GraphLoader ¶
type GraphLoader func(context.Context, id.DatasetID, ...id.DatasetSchemaFieldID) (List, *Field, error)
func GraphLoaderFromMap ¶
func GraphLoaderFromMap(m Map) GraphLoader
func GraphLoaderFromMapAndGraph ¶
func GraphLoaderFromMapAndGraph(m Map, g GraphLoader) GraphLoader
type LatLngHeight ¶
type LatLngHeight struct { Lat float64 `mapstructure:"lat"` Lng float64 `mapstructure:"lng"` Height float64 `mapstructure:"height"` }
LatLngHeight _
func LatLngHeightFrom ¶
func LatLngHeightFrom(m interface{}) (LatLngHeight, bool)
LatLngHeightFrom _
type List ¶
type List []*Dataset
List _
func (List) FilterByDatasetSchema ¶
func (l List) FilterByDatasetSchema(s id.DatasetSchemaID) List
FilterByDatasetSchema _
func (List) FindDatasetBySource ¶
FindDatasetBySource _
func (List) GraphLoader ¶
func (l List) GraphLoader() GraphLoader
type Loader ¶
func LoaderFrom ¶
type Map ¶
Map _
func (Map) GraphLoader ¶
func (dm Map) GraphLoader() GraphLoader
func (Map) GraphSearchByFields ¶
func (dm Map) GraphSearchByFields(root id.DatasetID, fields ...id.DatasetSchemaFieldID) (List, *Field)
GraphSearchByFields _
type Schema ¶
type Schema struct {
// contains filtered or unexported fields
}
Schema _
func (*Schema) FieldBySource ¶
func (d *Schema) FieldBySource(source Source) *SchemaField
FieldBySource _
func (*Schema) FieldDiffBySource ¶
func (d *Schema) FieldDiffBySource(d2 *Schema) SchemaFieldDiff
FieldDiffBySource _
func (*Schema) FieldRef ¶
func (d *Schema) FieldRef(id *id.DatasetSchemaFieldID) *SchemaField
FieldRef _
func (*Schema) RepresentativeField ¶
func (d *Schema) RepresentativeField() *SchemaField
RepresentativeField _
func (*Schema) RepresentativeFieldID ¶
func (d *Schema) RepresentativeFieldID() *id.DatasetSchemaFieldID
RepresentativeFieldID _
type SchemaBuilder ¶
type SchemaBuilder struct {
// contains filtered or unexported fields
}
SchemaBuilder _
func (*SchemaBuilder) Dynamic ¶
func (b *SchemaBuilder) Dynamic(dynamic bool) *SchemaBuilder
Dynamic _
func (*SchemaBuilder) Fields ¶
func (b *SchemaBuilder) Fields(fields []*SchemaField) *SchemaBuilder
Fields _
func (*SchemaBuilder) RepresentativeField ¶
func (b *SchemaBuilder) RepresentativeField(representativeField id.DatasetSchemaFieldID) *SchemaBuilder
RepresentativeField _
func (*SchemaBuilder) Scene ¶
func (b *SchemaBuilder) Scene(scene id.SceneID) *SchemaBuilder
Scene _
func (*SchemaBuilder) Source ¶
func (b *SchemaBuilder) Source(source Source) *SchemaBuilder
Source _
type SchemaField ¶
type SchemaField struct {
// contains filtered or unexported fields
}
SchemaField _
type SchemaFieldBuilder ¶
type SchemaFieldBuilder struct {
// contains filtered or unexported fields
}
SchemaFieldBuilder _
func (*SchemaFieldBuilder) Build ¶
func (b *SchemaFieldBuilder) Build() (*SchemaField, error)
Build _
func (*SchemaFieldBuilder) ID ¶
func (b *SchemaFieldBuilder) ID(id id.DatasetSchemaFieldID) *SchemaFieldBuilder
ID _
func (*SchemaFieldBuilder) MustBuild ¶
func (b *SchemaFieldBuilder) MustBuild() *SchemaField
MustBuild _
func (*SchemaFieldBuilder) Name ¶
func (b *SchemaFieldBuilder) Name(name string) *SchemaFieldBuilder
Name _
func (*SchemaFieldBuilder) Ref ¶
func (b *SchemaFieldBuilder) Ref(ref *id.DatasetSchemaID) *SchemaFieldBuilder
Ref _
func (*SchemaFieldBuilder) Source ¶
func (b *SchemaFieldBuilder) Source(source Source) *SchemaFieldBuilder
Source _
func (*SchemaFieldBuilder) Type ¶
func (b *SchemaFieldBuilder) Type(dataType ValueType) *SchemaFieldBuilder
Type _
type SchemaFieldDiff ¶
type SchemaFieldDiff struct { Added []*SchemaField Removed []*SchemaField Replaced map[id.DatasetSchemaFieldID]*SchemaField }
SchemaFieldDiff _
type SchemaGraphIterator ¶
type SchemaGraphIterator struct {
// contains filtered or unexported fields
}
SchemaGraphIterator は、データセットをグラフ探索するためのイテレータです。
func SchemaGraphIteratorFrom ¶
func SchemaGraphIteratorFrom(root id.DatasetSchemaID, depth int) *SchemaGraphIterator
SchemaGraphIteratorFrom _
func (*SchemaGraphIterator) Next ¶
func (di *SchemaGraphIterator) Next(d *Schema) (id.DatasetSchemaID, bool)
Next _
type SchemaMap ¶
type SchemaMap map[id.DatasetSchemaID]*Schema
SchemaMap _
func (SchemaMap) GraphSearchByFields ¶
func (dsm SchemaMap) GraphSearchByFields(root id.DatasetSchemaID, fields ...id.DatasetSchemaFieldID) (SchemaList, *SchemaField)
GraphSearchByFields _
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value _
func (*Value) Interface ¶
func (v *Value) Interface() interface{}
Interface converts the value into generic representation
func (*Value) ValueLatLngHeight ¶
func (v *Value) ValueLatLngHeight() *LatLngHeight
ValueLatLngHeight _
type ValueType ¶
type ValueType string
ValueType _
const ( // ValueTypeBool _ ValueTypeBool ValueType = "bool" // ValueTypeNumber _ ValueTypeNumber ValueType = "number" // ValueTypeString _ ValueTypeString ValueType = "string" // ValueTypeRef _ ValueTypeRef ValueType = "ref" // ValueTypeURL _ ValueTypeURL ValueType = "url" // ValueTypeLatLng _ ValueTypeLatLng ValueType = "latlng" // ValueTypeLatLngHeight _ ValueTypeLatLngHeight ValueType = "latlngheight" )