// TOML encodes to toml string.
173119
func (i *InfluxDBV2) TOML() string {
	s := make([]string, len(i.URLs))
	for k, v := range i.URLs {
		s[k] = strconv.Quote(v)
	}
	return fmt.Sprintf(`[[outputs.%s]]	
  ## The URLs of the InfluxDB cluster nodes.
  ##
  ## Multiple URLs can be specified for a single cluster, only ONE of the
  ## urls will be written to each interval.
  ## urls exp: http://127.0.0.1:9999
  urls = [%s]

  ## Token for authentication.
  token = "%s"

  ## Organization is the name of the organization you wish to write to; must exist.
  organization = "%s"

  ## Destination bucket to write into.
  bucket = "%s"
`, i.PluginName(), strings.Join(s, ", "), i.Token, i.Organization, i.Bucket)
}
97417
func (soc *Socket) SetHeartbeatTtl(value time.Duration) error {
	if minor < 2 {
		return ErrorNotImplemented42
	}
	val := int(value / time.Millisecond)
	return soc.setInt(C.ZMQ_HEARTBEAT_TTL, val)
}
1254455
func (tc TelegrafConfig) TOML() string {
	plugins := ""
	for _, p := range tc.Plugins {
		plugins += p.Config.TOML()
	}
	interval := time.Duration(tc.Agent.Interval * 1000000)
	return fmt.Sprintf(`# Configuration for telegraf agent
[agent]
  ## Default data collection interval for all inputs
  interval = "%s"
  ## Rounds collection interval to 'interval'
  ## ie, if interval="10s" then always collect on :00, :10, :20, etc.
  round_interval = true

  ## Telegraf will send metrics to outputs in batches of at most
  ## metric_batch_size metrics.
  ## This controls the size of writes that Telegraf sends to output plugins.
  metric_batch_size = 1000

  ## For failed writes, telegraf will cache metric_buffer_limit metrics for each
  ## output, and will flush this buffer on a successful write. Oldest metrics
  ## are dropped first when this buffer fills.
  ## This buffer only fills when writes fail to output plugin(s).
  metric_buffer_limit = 10000

  ## Collection jitter is used to jitter the collection by a random amount.
  ## Each plugin will sleep for a random time within jitter before collecting.
  ## This can be used to avoid many plugins querying things like sysfs at the
  ## same time, which can have a measurable effect on the system.
  collection_jitter = "0s"

  ## Default flushing interval for all outputs. Maximum flush_interval will be
  ## flush_interval + flush_jitter
  flush_interval = "10s"
  ## Jitter the flush interval by a random amount. This is primarily to avoid
  ## large write spikes for users running a large number of telegraf instances.
  ## ie, a jitter of 5s and interval 10s means flushes will happen every 10-15s
  flush_jitter = "0s"

  ## By default or when set to "0s", precision will be set to the same
  ## timestamp order as the collection interval, with the maximum being 1s.
  ##   ie, when interval = "10s", precision will be "1s"
  ##       when interval = "250ms", precision will be "1ms"
  ## Precision will NOT be used for service inputs. It is up to each individual
  ## service input to set the timestamp at the appropriate precision.
  ## Valid time units are "ns", "us" (or "µs"), "ms", "s".
  precision = ""

  ## Logging configuration:
  ## Run telegraf with debug log messages.
  debug = false
  ## Run telegraf in quiet mode (error log messages only).
  quiet = false
  ## Specify the log file name. The empty string means to log to stderr.
  logfile = ""

  ## Override default hostname, if empty use os.Hostname()
  hostname = ""
  ## If set to true, do no set the "host" tag in the telegraf agent.
  omit_hostname = false
%s`, interval.String(), plugins)
}
812929
func (state *TextEditor) tonl(start int, dir int) int {
	sz := len(state.Buffer)

	i := start
	if i < 0 {
		return 0
	}
	if i >= sz {
		i = sz - 1
	}
	for ; (i >= 0) && (i < sz); i += dir {
		c := state.Buffer[i]

		if c == '\n' {
			if dir >= 0 {
				return i
			} else {
				return i + 1
			}
		}
	}
	if dir < 0 {
		return 0
	} else {
		return sz
	}
}
932963
func (j *JSONMarshaler) Unmarshal(data []byte, v interface{}) error {
	return json.Unmarshal(data, v)
}
350199
func (s *CreateBranchInput) SetTtl(v string) *CreateBranchInput {
	s.Ttl = &v
	return s
}
318395
func (s *AttributeValue) SetL(v []*AttributeValue) *AttributeValue {
	s.L = v
	return s
}
1301242
func (c *Context) SetTmpl(args ...string) *Context {
	c.Tmpl = c.TmplPath(args...)
	return c
}
1026935
func (_ENS *ENSSession) Ttl(node [32]byte) (uint64, error) {
	return _ENS.Contract.Ttl(&_ENS.CallOpts, node)
}
489524
func (u UnmarshalerFunc) Unmarshal(data []byte, v interface{}) error {
	return u(data, v)
}
568948
func (f *File) TOML() string {
	s := make([]string, len(f.Files))
	for k, v := range f.Files {
		if v.Typ == "stdout" {
			s[k] = strconv.Quote(v.Typ)
			continue
		}
		s[k] = strconv.Quote(v.Path)
	}
	return fmt.Sprintf(`[[outputs.%s]]
  ## Files to write to, "stdout" is a specially handled file.
  files = [%s]
`, f.PluginName(), strings.Join(s, ", "))
}
610864
func (r *Redis) TOML() string {
	s := make([]string, len(r.Servers))
	for k, v := range r.Servers {
		s[k] = strconv.Quote(v)
	}
	password := `  # password = ""`
	if r.Password != "" {
		password = fmt.Sprintf(`  password = "%s"`, r.Password)
	}
	return fmt.Sprintf(`[[inputs.%s]]
  ## specify servers via a url matching:
  ##  [protocol://][:password]@address[:port]
  ##  e.g.
  ##    tcp://localhost:6379
  ##    tcp://:password@192.168.99.100
  ##    unix:///var/run/redis.sock
  ##
  ## If no servers are specified, then localhost is used as the host.
  ## If no port is specified, 6379 is used
  servers = [%s]

  ## specify server password
%s
`, r.PluginName(), strings.Join(s, ", "), password)
}
732740
func (s *Branch) SetTtl(v string) *Branch {
	s.Ttl = &v
	return s
}
583695
func (a *Assertions) Nil(object interface{}, msgAndArgs ...interface{}) bool {
	return Nil(a.t, object, msgAndArgs...)
}
752324
func (m *Metadata) SetTTL(clock clockwork.Clock, ttl time.Duration) {
	expireTime := clock.Now().UTC().Add(ttl)
	m.Expires = &expireTime
}
1000292
func Nil(t testing.TB, expr interface{}, args ...interface{}) {
	assert(t, IsNil(expr), args, []interface{}{"Nil 失败，实际值为[%T:%[1]v]", expr})
}
80736
func (s *UpdateTrafficPolicyInstanceInput) SetTTL(v int64) *UpdateTrafficPolicyInstanceInput {
	s.TTL = &v
	return s
}