remove index and field MarshalJSON

This commit is contained in:
Travis Turner 2018-07-05 20:50:00 -05:00
parent 7bde403faa
commit bf2b4e9284
No known key found for this signature in database
GPG key ID: 7F08008DFD9314C9
2 changed files with 0 additions and 34 deletions

View file

@ -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] }

View file

@ -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 }