// Read reads a config
542590
func (r *YAML) Read(name string) ([]byte, error) {
	p, ok := r.d[name]
	if !ok {
		return nil, errNotFound
	}
	return []byte(p), nil
}
227095
func (w *wizard) read() string {
	fmt.Printf("> ")
	text, err := w.in.ReadString('\n')
	if err != nil {
		log.Crit("Failed to read user input", "err", err)
	}
	return strings.TrimSpace(text)
}
1293610
func (c *Conn) Read(p []byte) (int, error) {
	return c.reader.Read(p)
}
1239048
func (conf *PluginConfig) Read(values tcontainer.MarshalMap) error {
	var err error
	errors := tgo.NewErrorStack()
	errors.SetFormat(tgo.ErrorStackFormatCSV)
	for key, settingValue := range values {

		switch key {
		case "Type":
			conf.Typename, err = values.String(key)
			errors.Push(err)

		case "Enable":
			conf.Enable, err = values.Bool(key)
			errors.Push(err)

		default:
			// If the value is a marshalmap candidate -> convert it
			switch settingValue.(type) {
			case map[interface{}]interface{}, map[string]interface{}, tcontainer.MarshalMap:
				mmap, err := tcontainer.ConvertToMarshalMap(settingValue, nil)
				if !errors.Push(err) {
					conf.Settings[key] = mmap
				}

			default:
				conf.Settings[key] = settingValue
			}
		}
	}

	// Sanity checks and informal messages
	if conf.Typename == "" {
		errors.Pushf("Plugin '%s' does not define a type", conf.ID)
	}

	if !TypeRegistry.IsTypeRegistered(conf.Typename) {
		if suggestion := suggestType(conf.Typename); suggestion != "" {
			errors.Pushf("Plugin '%s' is using an unknown type '%s'. Did you mean '%s'?", conf.ID, conf.Typename, suggestion)
		} else {
			errors.Pushf("Plugin '%s' is using an unknown type '%s'.", conf.ID, conf.Typename)
		}
	}

	if !conf.Enable {
		logrus.Infof("Plugin %s has been disabled", conf.ID)
	}

	return errors.OrNil()
}
690752
func (f *KbfsReadCloseResetter) Read(p []byte) (int, error) {
	content, err := f.client.SimpleFSRead(f.ctx, keybase1.SimpleFSReadArg{
		OpID:   f.opid,
		Offset: atomic.LoadInt64(&f.offset),
		Size:   len(p),
	})
	if err != nil {
		return 0, err
	}
	if len(content.Data) == 0 {
		// Unfortunately SimpleFSRead doesn't return EOF error.
		return 0, io.EOF
	}
	atomic.AddInt64(&f.offset, int64(len(content.Data)))
	copy(p, content.Data)
	return len(content.Data), nil
}
1022565
func (s *CfgNetworkState) Read(id string) error {
	key := fmt.Sprintf(networkConfigPath, id)
	return s.StateDriver.ReadState(key, s, json.Unmarshal)
}
1086317
func Read(r io.Reader, data ...interface{}) error {
	for _, v := range data {
		if err := binary.Read(r, binary.BigEndian, v); err != nil {
			return err
		}
	}

	return nil
}
693696
func (c *cmd) readConfig() *config.RuntimeConfig {
	b, err := config.NewBuilder(c.flagArgs)
	if err != nil {
		c.UI.Error(err.Error())
		return nil
	}
	cfg, err := b.BuildAndValidate()
	if err != nil {
		c.UI.Error(err.Error())
		return nil
	}
	for _, w := range b.Warnings {
		c.UI.Warn(w)
	}
	return &cfg
}
1246714
func (r *Reader) Read() ([]byte, error) {
	r.Lock()
	defer r.Unlock()

	if _, err := io.ReadFull(r.r, r.buff[:]); err != nil {
		return nil, err
	}

	length := int64(binary.BigEndian.Uint32(r.buff[:]))
	if length < _fastPathFrameSize {
		return r.readFastPath(length)
	}

	var buff bytes.Buffer
	_, err := io.CopyN(&buff, r.r, length)
	if err != nil {
		return nil, err
	}

	return buff.Bytes(), nil
}
1104834
func (r *reader) Read(b []byte) (int, error) {
	r.Do(term.ClearAll)
	n, err := r.ReadCloser.Read(b)
	r.written += n
	r.p.ValueInt(r.written)
	r.render(term.CenterLine(r.p.String()))
	return n, err
}
439806
func (c *Client) Read(name string) ([]byte, error) {
	f := c.Open(name)
	defer f.Close()
	return ioutil.ReadAll(f)
}
378313
func (fc *Flow) Read(s Sourcer) (ret *Dataset) {
	return s.Generate(fc)
}
219740
func (m *Module) ReadConfig(i interface{}) error {
	m.configDefs = append(m.configDefs, reflect.TypeOf(i))
	return json.Unmarshal(m.Byte, i)
}
1202221
func (c *Conn) Read(p []byte) (int, error) {
	i, err := c.NetConn.Read(p)
	return i, err
}
270691
func (c *conn) Read(b []byte) (int, error) {
	return c.buf.Read(b)
}
900553
func (r *errorReader) Read(b []byte) (int, error) {
	if r.err != nil {
		return 0, r.err
	}
	var n int
	n, r.err = r.r.Read(b)
	return n, r.err
}
704549
func (d *Document) Read(variable interface{}) *Document {
	d.setDefaultSchema()

	value := reflect.ValueOf(variable)
	d.read(value.Type())
	return d
}