client.go
func (c *Client) Schema() (*Schema, error) {
	span := c.tracer.StartSpan("Client.Schema")
	defer span.Finish()

	var indexes []SchemaIndex
	indexes, err := c.readSchema()
	if err != nil {
		return nil, err
	}
	schema := NewSchema()
	for _, indexInfo := range indexes {
		index := schema.indexWithOptions(indexInfo.Name, indexInfo.ShardWidth, indexInfo.Options.asIndexOptions())
		for _, fieldInfo := range indexInfo.Fields {
			index.fieldWithOptions(fieldInfo.Name, fieldInfo.Options.asFieldOptions())
		}
	}
	return schema, nil
}
func (c *Client) Schema() (*Schema, error) {
	span := c.tracer.StartSpan("Client.Schema")
	defer span.Finish()

	var indexes []SchemaIndex
	indexes, err := c.readSchema()
	if err != nil {
		return nil, err
	}
	schema := NewSchema()
	for _, indexInfo := range indexes {
		index := schema.indexWithOptions(indexInfo.Name, indexInfo.ShardWidth, indexInfo.Options.asIndexOptions())
		for _, fieldInfo := range indexInfo.Fields {
			index.fieldWithOptions(fieldInfo.Name, fieldInfo.Options.asFieldOptions())
		}
	}
	return schema, nil
}
func ( c * Client ) Schema ( ) ( * Schema , error ) { span := c . tracer . StartSpan ( " " ) defer span . Finish ( ) var indexes [ ] SchemaIndex indexes , err := c . readSchema ( ) if err != nil { return nil , err } schema := NewSchema ( ) for _ , indexInfo := range indexes { index := schema . indexWithOptions ( indexInfo . Name , indexInfo . ShardWidth , indexInfo . Options . asIndexOptions ( ) ) for _ , fieldInfo := range indexInfo . Fields { index . fieldWithOptions ( fieldInfo . Name , fieldInfo . Options . asFieldOptions ( ) ) } } return schema , nil }
// Schema returns the indexes and fields on the server.
Schema returns the indexes and fields on the server .