func (sq *SearchQuery) Unmarshal(src []byte) ([]byte, error) {
	tail, minTs, err := encoding.UnmarshalVarInt64(src)
	if err != nil {
		return src, fmt.Errorf("cannot unmarshal MinTimestamp: %s", err)
	}
	sq.MinTimestamp = minTs
	src = tail

	tail, maxTs, err := encoding.UnmarshalVarInt64(src)
	if err != nil {
		return src, fmt.Errorf("cannot unmarshal MaxTimestamp: %s", err)
	}
	sq.MaxTimestamp = maxTs
	src = tail

	tail, tfssCount, err := encoding.UnmarshalVarUint64(src)
	if err != nil {
		return src, fmt.Errorf("cannot unmarshal the count of TagFilterss: %s", err)
	}
	if n := int(tfssCount) - cap(sq.TagFilterss); n > 0 {
		sq.TagFilterss = append(sq.TagFilterss[:cap(sq.TagFilterss)], make([][]TagFilter, n)...)
	}
	sq.TagFilterss = sq.TagFilterss[:tfssCount]
	src = tail

	for i := 0; i < int(tfssCount); i++ {
		tail, tfsCount, err := encoding.UnmarshalVarUint64(src)
		if err != nil {
			return src, fmt.Errorf("cannot unmarshal the count of TagFilters: %s", err)
		}
		src = tail

		tagFilters := sq.TagFilterss[i]
		if n := int(tfsCount) - cap(tagFilters); n > 0 {
			tagFilters = append(tagFilters[:cap(tagFilters)], make([]TagFilter, n)...)
		}
		tagFilters = tagFilters[:tfsCount]
		for j := 0; j < int(tfsCount); j++ {
			tail, err := tagFilters[j].Unmarshal(src)
			if err != nil {
				return tail, fmt.Errorf("cannot unmarshal TagFilter #%d: %s", j, err)
			}
			src = tail
		}
		sq.TagFilterss[i] = tagFilters
	}

	return src, nil
}
// Unmarshal unmarshals sq from src and returns the tail.
Unmarshal unmarshals sq from src and returns the tail.
// Unmarshal unmarshals sq from src and returns the tail .
func (sq *SearchQuery) Unmarshal(src []byte) ([]byte, error) {
	tail, minTs, err := encoding.UnmarshalVarInt64(src)
	if err != nil {
		return src, fmt.Errorf("cannot unmarshal MinTimestamp: %s", err)
	}
	sq.MinTimestamp = minTs
	src = tail
	tail, maxTs, err := encoding.UnmarshalVarInt64(src)
	if err != nil {
		return src, fmt.Errorf("cannot unmarshal MaxTimestamp: %s", err)
	}
	sq.MaxTimestamp = maxTs
	src = tail
	tail, tfssCount, err := encoding.UnmarshalVarUint64(src)
	if err != nil {
		return src, fmt.Errorf("cannot unmarshal the count of TagFilterss: %s", err)
	}
	if n := int(tfssCount) - cap(sq.TagFilterss); n > 0 {
		sq.TagFilterss = append(sq.TagFilterss[:cap(sq.TagFilterss)], make([][]TagFilter, n)...)
	}
	sq.TagFilterss = sq.TagFilterss[:tfssCount]
	src = tail
	for i := 0; i < int(tfssCount); i++ {
		tail, tfsCount, err := encoding.UnmarshalVarUint64(src)
		if err != nil {
			return src, fmt.Errorf("cannot unmarshal the count of TagFilters: %s", err)
		}
		src = tail
		tagFilters := sq.TagFilterss[i]
		if n := int(tfsCount) - cap(tagFilters); n > 0 {
			tagFilters = append(tagFilters[:cap(tagFilters)], make([]TagFilter, n)...)
		}
		tagFilters = tagFilters[:tfsCount]
		for j := 0; j < int(tfsCount); j++ {
			tail, err := tagFilters[j].Unmarshal(src)
			if err != nil {
				return tail, fmt.Errorf("cannot unmarshal TagFilter #%d: %s", j, err)
			}
			src = tail
		}
		sq.TagFilterss[i] = tagFilters
	}
	return src, nil
}
func ( sq * SearchQuery ) Unmarshal ( src [ ] byte ) ( [ ] byte , error ) { tail , minTs , err := encoding . UnmarshalVarInt64 ( src ) if err != nil { return src , fmt . Errorf ( " " , err ) } sq . MinTimestamp = minTs src = tail tail , maxTs , err := encoding . UnmarshalVarInt64 ( src ) if err != nil { return src , fmt . Errorf ( " " , err ) } sq . MaxTimestamp = maxTs src = tail tail , tfssCount , err := encoding . UnmarshalVarUint64 ( src ) if err != nil { return src , fmt . Errorf ( " " , err ) } if n := int ( tfssCount ) - cap ( sq . TagFilterss ) ; n > 0 { sq . TagFilterss = append ( sq . TagFilterss [ : cap ( sq . TagFilterss ) ] , make ( [ ] [ ] TagFilter , n ) ... ) } sq . TagFilterss = sq . TagFilterss [ : tfssCount ] src = tail for i := 0 ; i < int ( tfssCount ) ; i ++ { tail , tfsCount , err := encoding . UnmarshalVarUint64 ( src ) if err != nil { return src , fmt . Errorf ( " " , err ) } src = tail tagFilters := sq . TagFilterss [ i ] if n := int ( tfsCount ) - cap ( tagFilters ) ; n > 0 { tagFilters = append ( tagFilters [ : cap ( tagFilters ) ] , make ( [ ] TagFilter , n ) ... ) } tagFilters = tagFilters [ : tfsCount ] for j := 0 ; j < int ( tfsCount ) ; j ++ { tail , err := tagFilters [ j ] . Unmarshal ( src ) if err != nil { return tail , fmt . Errorf ( " " , j , err ) } src = tail } sq . TagFilterss [ i ] = tagFilters } return src , nil }
Unmarshal unmarshals sq from src and returns the tail.
Unmarshal unmarshals sq from src and returns the tail .