Documentation ¶
Index ¶
- Variables
- type Builder
- func (b *Builder) Build() (*Dataset, error)
- func (b *Builder) Fields(fields []*Field) *Builder
- func (b *Builder) ID(id ID) *Builder
- func (b *Builder) MustBuild() *Dataset
- func (b *Builder) NewID() *Builder
- func (b *Builder) Scene(scene SceneID) *Builder
- func (b *Builder) Schema(schema SchemaID) *Builder
- func (b *Builder) Source(source string) *Builder
- type Coordinates
- type Dataset
- func (d *Dataset) Field(id FieldID) *Field
- func (d *Dataset) FieldBySource(source string) *Field
- func (d *Dataset) FieldByType(t ValueType) *Field
- func (d *Dataset) FieldRef(id *FieldID) *Field
- func (d *Dataset) Fields() []*Field
- func (d *Dataset) ID() (i ID)
- func (d *Dataset) Interface(s *Schema) map[string]interface{}
- func (d *Dataset) InterfaceWithFieldIDs() map[string]interface{}
- func (d *Dataset) NameField(ds *Schema) *Field
- func (d *Dataset) Scene() (i SceneID)
- func (d *Dataset) Schema() (i SchemaID)
- func (d *Dataset) Source() string
- type DatasetCSVParser
- type Diff
- type Field
- type FieldID
- type FieldIDSet
- type GraphIterator
- type GraphLoader
- type ID
- type IDSet
- type LatLng
- type LatLngHeight
- type List
- func (l List) DiffBySource(l2 List) Diff
- func (l List) FilterByDatasetSchema(s SchemaID) List
- func (l List) FindDataset(id ID) *Dataset
- func (l List) FindDatasetBySource(s string) *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
- type Loader
- type Map
- type OptionalValue
- type Polygon
- type Rect
- type SceneID
- type SceneIDSet
- type Schema
- func (d *Schema) Dynamic() bool
- func (d *Schema) Field(id FieldID) *SchemaField
- func (d *Schema) FieldBySource(source string) *SchemaField
- func (d *Schema) FieldByType(t ValueType) *SchemaField
- func (d *Schema) FieldDiffBySource(d2 *Schema) SchemaFieldDiff
- func (d *Schema) FieldRef(id *FieldID) *SchemaField
- func (d *Schema) Fields() []*SchemaField
- func (d *Schema) ID() (i SchemaID)
- func (d *Schema) IDRef() *SchemaID
- func (d *Schema) Name() string
- func (u *Schema) Rename(name string)
- func (d *Schema) RepresentativeField() *SchemaField
- func (d *Schema) RepresentativeFieldID() *FieldID
- func (d *Schema) Scene() (i SceneID)
- func (d *Schema) Source() (s string)
- 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 SchemaID) *SchemaBuilder
- func (b *SchemaBuilder) MustBuild() *Schema
- func (b *SchemaBuilder) Name(name string) *SchemaBuilder
- func (b *SchemaBuilder) NewID() *SchemaBuilder
- func (b *SchemaBuilder) RepresentativeField(representativeField FieldID) *SchemaBuilder
- func (b *SchemaBuilder) Scene(scene SceneID) *SchemaBuilder
- func (b *SchemaBuilder) Source(source string) *SchemaBuilder
- type SchemaField
- type SchemaFieldBuilder
- func (b *SchemaFieldBuilder) Build() (*SchemaField, error)
- func (b *SchemaFieldBuilder) ID(id FieldID) *SchemaFieldBuilder
- func (b *SchemaFieldBuilder) MustBuild() *SchemaField
- func (b *SchemaFieldBuilder) Name(name string) *SchemaFieldBuilder
- func (b *SchemaFieldBuilder) NewID() *SchemaFieldBuilder
- func (b *SchemaFieldBuilder) Ref(ref *SchemaID) *SchemaFieldBuilder
- func (b *SchemaFieldBuilder) Source(source string) *SchemaFieldBuilder
- func (b *SchemaFieldBuilder) Type(dataType ValueType) *SchemaFieldBuilder
- type SchemaFieldDiff
- type SchemaGraphIterator
- type SchemaID
- type SchemaIDSet
- type SchemaList
- type SchemaMap
- type Value
- func (v *Value) Cast(vt ValueType) *Value
- func (v *Value) Clone() *Value
- func (v *Value) Interface() interface{}
- func (v *Value) IsEmpty() bool
- func (v *Value) Some() *OptionalValue
- func (v *Value) Type() ValueType
- func (v *Value) Value() interface{}
- func (v *Value) ValueBool() *bool
- func (v *Value) ValueCoordinates() *Coordinates
- func (v *Value) ValueLatLng() *LatLng
- func (v *Value) ValueLatLngHeight() *LatLngHeight
- func (v *Value) ValueNumber() *float64
- func (v *Value) ValuePolygon() *Polygon
- func (v *Value) ValueRect() *Rect
- func (v *Value) ValueRef() *string
- func (v *Value) ValueString() *string
- func (v *Value) ValueURL() *url.URL
- type ValueType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrFailedToParseCSVorTSVFile error = errors.New("failed to parse file content") ErrIncompatibleSchema error = errors.New("schema is not compatible with csv") ErrDuplicatiedNameFields error = errors.New("failed to parse, name-duplicated fields") )
View Source
var ( ValueTypeUnknown = ValueType(value.TypeUnknown) ValueTypeBool = ValueType(value.TypeBool) ValueTypeNumber = ValueType(value.TypeNumber) ValueTypeString = ValueType(value.TypeString) ValueTypeRef = ValueType(value.TypeRef) ValueTypeURL = ValueType(value.TypeURL) ValueTypeLatLng = ValueType(value.TypeLatLng) ValueTypeLatLngHeight = ValueType(value.TypeLatLngHeight) ValueTypeCoordinates = ValueType(value.TypeCoordinates) ValueTypeRect = ValueType(value.TypeRect) TypePolygon = ValueType(value.TypePolygon) )
View Source
var ErrInvalidID = id.ErrInvalidID
View Source
var FieldIDFrom = id.DatasetFieldIDFrom
View Source
var FieldIDFromRef = id.DatasetFieldIDFromRef
View Source
var IDFrom = id.DatasetIDFrom
View Source
var IDFromRef = id.DatasetIDFromRef
View Source
var MustFieldID = id.MustDatasetFieldID
View Source
var MustID = id.MustDatasetID
View Source
var MustSceneID = id.MustSceneID
View Source
var MustSchemaID = id.MustDatasetSchemaID
View Source
var NewFieldID = id.NewDatasetFieldID
View Source
var NewFieldIDset = id.NewDatasetFieldIDSet
View Source
var NewID = id.NewDatasetID
View Source
var NewIDSet = id.NewDatasetIDSet
View Source
var NewSceneID = id.NewSceneID
View Source
var NewSceneIDset = id.NewSceneIDSet
View Source
var NewSchemaID = id.NewDatasetSchemaID
View Source
var NewSchemaIDset = id.NewDatasetSchemaIDSet
View Source
var SceneIDFrom = id.SceneIDFrom
View Source
var SceneIDFromRef = id.SceneIDFromRef
View Source
var SchemaIDFrom = id.DatasetSchemaIDFrom
View Source
var SchemaIDFromRef = id.DatasetSchemaIDFromRef
Functions ¶
This section is empty.
Types ¶
type Coordinates ¶ added in v0.3.0
type Coordinates = value.Coordinates
type Dataset ¶
type Dataset struct {
// contains filtered or unexported fields
}
func (*Dataset) FieldBySource ¶
func (*Dataset) FieldByType ¶
func (*Dataset) Interface ¶ added in v0.3.0
Interface returns a simple and human-readable representation of the dataset
func (*Dataset) InterfaceWithFieldIDs ¶ added in v0.3.0
Interface is almost same as Interface, but keys of the map are IDs of fields.
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 SceneID) error
func (*DatasetCSVParser) Init ¶
func (p *DatasetCSVParser) Init() error
type FieldID ¶ added in v0.4.0
type FieldID = id.DatasetFieldID
type FieldIDSet ¶ added in v0.4.0
type FieldIDSet = id.DatasetFieldIDSet
type GraphIterator ¶
type GraphIterator struct {
// contains filtered or unexported fields
}
GraphIterator is a iterator for graphically exploring a dataset.
func GraphIteratorFrom ¶
func GraphIteratorFrom(root ID, depth int) *GraphIterator
func (*GraphIterator) Result ¶
func (di *GraphIterator) Result() Map
type GraphLoader ¶
func GraphLoaderFromMap ¶
func GraphLoaderFromMap(m Map) GraphLoader
func GraphLoaderFromMapAndGraph ¶
func GraphLoaderFromMapAndGraph(m Map, g GraphLoader) GraphLoader
type IDSet ¶ added in v0.4.0
type IDSet = id.DatasetIDSet
type LatLngHeight ¶
type LatLngHeight = value.LatLngHeight
type List ¶
type List []*Dataset
func (List) DiffBySource ¶
func (List) FilterByDatasetSchema ¶
func (List) FindDataset ¶
func (List) FindDatasetBySource ¶
func (List) GraphLoader ¶
func (l List) GraphLoader() GraphLoader
func (List) ToDatasetIds ¶
type Map ¶
func (Map) GraphLoader ¶
func (dm Map) GraphLoader() GraphLoader
func (Map) GraphSearchByFields ¶
type OptionalValue ¶ added in v0.3.0
type OptionalValue struct {
// contains filtered or unexported fields
}
func NewOptionalValue ¶ added in v0.3.0
func NewOptionalValue(t ValueType, v *Value) *OptionalValue
func OptionalValueFrom ¶ added in v0.3.0
func OptionalValueFrom(v *Value) *OptionalValue
func (*OptionalValue) Cast ¶ added in v0.3.0
func (ov *OptionalValue) Cast(t ValueType) *OptionalValue
func (*OptionalValue) Clone ¶ added in v0.3.0
func (ov *OptionalValue) Clone() *OptionalValue
func (*OptionalValue) SetValue ¶ added in v0.3.0
func (ov *OptionalValue) SetValue(v *Value)
func (*OptionalValue) Type ¶ added in v0.3.0
func (ov *OptionalValue) Type() ValueType
func (*OptionalValue) TypeAndValue ¶ added in v0.3.0
func (ov *OptionalValue) TypeAndValue() (ValueType, *Value)
func (*OptionalValue) Value ¶ added in v0.3.0
func (ov *OptionalValue) Value() *Value
type SceneIDSet ¶ added in v0.4.0
type SceneIDSet = id.SceneIDSet
type Schema ¶
type Schema struct {
// contains filtered or unexported fields
}
func (*Schema) Field ¶
func (d *Schema) Field(id FieldID) *SchemaField
func (*Schema) FieldBySource ¶
func (d *Schema) FieldBySource(source string) *SchemaField
func (*Schema) FieldByType ¶
func (d *Schema) FieldByType(t ValueType) *SchemaField
func (*Schema) FieldDiffBySource ¶
func (d *Schema) FieldDiffBySource(d2 *Schema) SchemaFieldDiff
func (*Schema) FieldRef ¶
func (d *Schema) FieldRef(id *FieldID) *SchemaField
func (*Schema) Fields ¶
func (d *Schema) Fields() []*SchemaField
func (*Schema) RepresentativeField ¶
func (d *Schema) RepresentativeField() *SchemaField
func (*Schema) RepresentativeFieldID ¶
type SchemaBuilder ¶
type SchemaBuilder struct {
// contains filtered or unexported fields
}
func NewSchema ¶
func NewSchema() *SchemaBuilder
func (*SchemaBuilder) Build ¶
func (b *SchemaBuilder) Build() (*Schema, error)
func (*SchemaBuilder) Dynamic ¶
func (b *SchemaBuilder) Dynamic(dynamic bool) *SchemaBuilder
func (*SchemaBuilder) Fields ¶
func (b *SchemaBuilder) Fields(fields []*SchemaField) *SchemaBuilder
func (*SchemaBuilder) ID ¶
func (b *SchemaBuilder) ID(id SchemaID) *SchemaBuilder
func (*SchemaBuilder) MustBuild ¶
func (b *SchemaBuilder) MustBuild() *Schema
func (*SchemaBuilder) Name ¶
func (b *SchemaBuilder) Name(name string) *SchemaBuilder
func (*SchemaBuilder) NewID ¶
func (b *SchemaBuilder) NewID() *SchemaBuilder
func (*SchemaBuilder) RepresentativeField ¶
func (b *SchemaBuilder) RepresentativeField(representativeField FieldID) *SchemaBuilder
func (*SchemaBuilder) Scene ¶
func (b *SchemaBuilder) Scene(scene SceneID) *SchemaBuilder
func (*SchemaBuilder) Source ¶
func (b *SchemaBuilder) Source(source string) *SchemaBuilder
type SchemaField ¶
type SchemaField struct {
// contains filtered or unexported fields
}
func (*SchemaField) Clone ¶ added in v0.4.0
func (d *SchemaField) Clone() *SchemaField
func (*SchemaField) ID ¶
func (d *SchemaField) ID() (i FieldID)
func (*SchemaField) IDRef ¶
func (d *SchemaField) IDRef() *FieldID
func (*SchemaField) Name ¶
func (d *SchemaField) Name() (n string)
func (*SchemaField) Ref ¶
func (d *SchemaField) Ref() *SchemaID
func (*SchemaField) Source ¶
func (d *SchemaField) Source() (s string)
func (*SchemaField) Type ¶
func (d *SchemaField) Type() (v ValueType)
type SchemaFieldBuilder ¶
type SchemaFieldBuilder struct {
// contains filtered or unexported fields
}
func NewSchemaField ¶
func NewSchemaField() *SchemaFieldBuilder
func (*SchemaFieldBuilder) Build ¶
func (b *SchemaFieldBuilder) Build() (*SchemaField, error)
func (*SchemaFieldBuilder) ID ¶
func (b *SchemaFieldBuilder) ID(id FieldID) *SchemaFieldBuilder
func (*SchemaFieldBuilder) MustBuild ¶
func (b *SchemaFieldBuilder) MustBuild() *SchemaField
func (*SchemaFieldBuilder) Name ¶
func (b *SchemaFieldBuilder) Name(name string) *SchemaFieldBuilder
func (*SchemaFieldBuilder) NewID ¶
func (b *SchemaFieldBuilder) NewID() *SchemaFieldBuilder
func (*SchemaFieldBuilder) Ref ¶
func (b *SchemaFieldBuilder) Ref(ref *SchemaID) *SchemaFieldBuilder
func (*SchemaFieldBuilder) Source ¶
func (b *SchemaFieldBuilder) Source(source string) *SchemaFieldBuilder
func (*SchemaFieldBuilder) Type ¶
func (b *SchemaFieldBuilder) Type(dataType ValueType) *SchemaFieldBuilder
type SchemaFieldDiff ¶
type SchemaFieldDiff struct { Added []*SchemaField Removed []*SchemaField Replaced map[FieldID]*SchemaField }
type SchemaGraphIterator ¶
type SchemaGraphIterator struct {
// contains filtered or unexported fields
}
SchemaGraphIterator は、データセットをグラフ探索するためのイテレータです。
func SchemaGraphIteratorFrom ¶
func SchemaGraphIteratorFrom(root SchemaID, depth int) *SchemaGraphIterator
func (*SchemaGraphIterator) Result ¶
func (di *SchemaGraphIterator) Result() SchemaMap
type SchemaID ¶ added in v0.4.0
type SchemaID = id.DatasetSchemaID
type SchemaIDSet ¶ added in v0.4.0
type SchemaIDSet = id.DatasetSchemaIDSet
type SchemaList ¶
type SchemaList []*Schema
func (SchemaList) Map ¶
func (dsl SchemaList) Map() SchemaMap
type SchemaMap ¶
func (SchemaMap) GraphSearchByFields ¶
func (dsm SchemaMap) GraphSearchByFields(root SchemaID, fields ...FieldID) (SchemaList, *SchemaField)
func (SchemaMap) Slice ¶
func (dsm SchemaMap) Slice() SchemaList
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
func ValueFromStringOrNumber ¶ added in v0.3.0
func (*Value) Some ¶ added in v0.4.0
func (v *Value) Some() *OptionalValue
func (*Value) ValueCoordinates ¶ added in v0.3.0
func (v *Value) ValueCoordinates() *Coordinates
func (*Value) ValueLatLng ¶
func (*Value) ValueLatLngHeight ¶
func (v *Value) ValueLatLngHeight() *LatLngHeight
func (*Value) ValueNumber ¶
func (*Value) ValuePolygon ¶ added in v0.3.0
func (*Value) ValueString ¶
type ValueType ¶
func (ValueType) MustBeValue ¶ added in v0.3.0
func (ValueType) None ¶ added in v0.4.0
func (vt ValueType) None() *OptionalValue
Source Files ¶
Click to show internal directories.
Click to hide internal directories.