mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
remove index and field MarshalJSON
This commit is contained in:
parent
7bde403faa
commit
bf2b4e9284
2 changed files with 0 additions and 34 deletions
15
field.go
15
field.go
|
|
@ -1092,21 +1092,6 @@ func (f *Field) ImportValue(columnIDs []uint64, values []int64) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (f *Field) MarshalJSON() ([]byte, error) {
|
||||
thing := struct {
|
||||
Name string `json:"name"`
|
||||
Options FieldOptions `json:"options"`
|
||||
Views []*ViewInfo `json:"views"`
|
||||
}{
|
||||
Name: f.Name(),
|
||||
Options: f.Options(),
|
||||
}
|
||||
for _, viewname := range f.viewNames() {
|
||||
thing.Views = append(thing.Views, &ViewInfo{Name: viewname})
|
||||
}
|
||||
return json.Marshal(thing)
|
||||
}
|
||||
|
||||
type fieldSlice []*Field
|
||||
|
||||
func (p fieldSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
|
||||
|
|
|
|||
19
index.go
19
index.go
|
|
@ -15,7 +15,6 @@
|
|||
package pilosa
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
|
@ -76,24 +75,6 @@ func NewIndex(path, name string) (*Index, error) {
|
|||
}, nil
|
||||
}
|
||||
|
||||
func (i *Index) MarshalJSON() ([]byte, error) {
|
||||
fields := make([]*Field, 0, len(i.fields))
|
||||
for _, f := range i.fields {
|
||||
|
||||
fields = append(fields, f)
|
||||
}
|
||||
thing := struct {
|
||||
Name string `json:"name"`
|
||||
Options IndexOptions `json:"options"`
|
||||
Fields []*Field `json:"fields"`
|
||||
}{
|
||||
Name: i.name,
|
||||
Options: i.Options(),
|
||||
Fields: fields,
|
||||
}
|
||||
return json.Marshal(thing)
|
||||
}
|
||||
|
||||
// Name returns name of the index.
|
||||
func (i *Index) Name() string { return i.name }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue