// FromString converts a version string into struct
777419
func FromString(versionString string) CiliumVersion {
	// string to parse: "0.13.90 a722bdb 2018-01-09T22:32:37+01:00 go version go1.9 linux/amd64"
	fields := strings.Split(versionString, " ")
	if len(fields) != 7 {
		return CiliumVersion{}
	}

	cver := CiliumVersion{
		Version:          fields[0],
		Revision:         fields[1],
		AuthorDate:       fields[2],
		GoRuntimeVersion: fields[5],
		Arch:             fields[6],
	}
	return cver
}
293526
func FromString(in string) (*Signature, error) {
	var res Signature = Signature{}
	var key string
	var value string

	for _, m := range signatureRegex.FindAllStringSubmatch(in, -1) {
		key = m[1]
		value = m[2]

		if key == "keyId" {
			res.KeyID = value
		} else if key == "algorithm" {
			alg, err := algorithmFromString(value)
			if err != nil {
				return nil, err
			}
			res.Algorithm = alg
		} else if key == "headers" {
			res.Headers = headerListFromString(value)
		} else if key == "signature" {
			res.Signature = value
		} else {
			return nil, errors.New(fmt.Sprintf("Unexpected key in signature '%s'", key))
		}
	}

	if len(res.Signature) == 0 {
		return nil, errors.New("Missing signature")
	}

	if len(res.KeyID) == 0 {
		return nil, errors.New("Missing keyId")
	}

	if res.Algorithm == nil {
		return nil, errors.New("Missing algorithm")
	}

	return &res, nil
}
29833
func (s *SelectQuery) From(tables ...string) *SelectQuery {
	s.from = tables
	return s
}
66765
func (d *Datum) ToString() (string, error) {
	switch d.Kind() {
	case KindInt64:
		return strconv.FormatInt(d.GetInt64(), 10), nil
	case KindUint64:
		return strconv.FormatUint(d.GetUint64(), 10), nil
	case KindFloat32:
		return strconv.FormatFloat(float64(d.GetFloat32()), 'f', -1, 32), nil
	case KindFloat64:
		return strconv.FormatFloat(float64(d.GetFloat64()), 'f', -1, 64), nil
	case KindString:
		return d.GetString(), nil
	case KindBytes:
		return d.GetString(), nil
	case KindMysqlTime:
		return d.GetMysqlTime().String(), nil
	case KindMysqlDuration:
		return d.GetMysqlDuration().String(), nil
	case KindMysqlDecimal:
		return d.GetMysqlDecimal().String(), nil
	case KindMysqlHex:
		return d.GetMysqlHex().ToString(), nil
	case KindMysqlBit:
		return d.GetMysqlBit().ToString(), nil
	case KindMysqlEnum:
		return d.GetMysqlEnum().String(), nil
	case KindMysqlSet:
		return d.GetMysqlSet().String(), nil
	default:
		return "", errors.Errorf("cannot convert %v(type %T) to string", d.GetValue(), d.GetValue())
	}
}
1109639
func FromStringTypes(s string) *Graph {
	p := NewParser(bytes.NewBuffer([]byte(s)))
	p.OgdlTypes()
	return p.Graph()
}
878768
func (f *FileName) FromString(name string) {
	name = strings.TrimPrefix(name, "/")

	cp := strings.Split(name, "/")

	cp = append([]string{serverPolicyRootShareName}, cp...)

	f.Name = strings.Join(cp, "\x00")
	f.Length = uint32(len(f.Name))
}
494529
func FromConfigString(config, configType string) (Provider, error) {
	v := newViper()
	m, err := readConfig(metadecoders.FormatFromString(configType), []byte(config))
	if err != nil {
		return nil, err
	}

	v.MergeConfigMap(m)

	return v, nil
}
708070
func (s *Scheduler) FromString(gstr string) (err error) {
	*s, err = SchedulerFromString(gstr)
	return
}
857400
func (m *Manifest) ToString() string {
	str := ""
	for fName, ckSum := range m.Data {
		str += fmt.Sprintf("%s %s\n", ckSum, fName)
	}
	return str
}
1089206
func (a *BucketSortAggregation) From(from int) *BucketSortAggregation {
	a.from = from
	return a
}
130944
func FromHexStr(str string) (uint8, error) {
	if len(str) == 0 {
		return 0, ErrorEmptyHexStr
	}

	if str[0] == '#' {
		str = str[1:]
	}
	v, err := strconv.ParseUint(str, 16, 24)
	if err != nil {
		return 0, ErrorHexParse
	}
	return FromInt(uint32((v << 8) + 0xFF)), nil
}
643690
func FromDecimalString(s string) *big.Int {
	var sc scanner
	z := new(big.Int)
	sc.scan(z, s)
	return z
}
1032692
func ToString(in interface{}) (string, error) {
	if val, err := cast.ToStringE(in); err == nil {
		return val, nil
	}
	return "", ErrBadType
}
44285
func FromJSON(from string) (types.Config, error) {
	c := newConfig()
	m := map[string]interface{}{}
	if err := json.Unmarshal([]byte(from), &m); err != nil {
		return nil, err
	}
	for k, v := range m {
		c.v.Set(k, v)
	}
	return c, nil
}
29530
func (s *shortcodeTemplates) fromName(name string) (shortcodeVariant, bool) {
	return s.fromVariantsSlice(templateVariants(name))
}
769710
func (s *SearchService) From(from int) *SearchService {
	s.searchSource = s.searchSource.From(from)
	return s
}
450815
func FromTo(value, fromLayout, toLayout string) (string, error) {
	t, err := time.Parse(fromLayout, strings.TrimSpace(value))
	if err != nil {
		return "", err
	}
	return t.Format(toLayout), nil
}