func (m *Meta) WriteOptions() *consulapi.WriteOptions { writeOpts := new(consulapi.WriteOptions) if os.Getenv("CONSUL_TOKEN") != "" { writeOpts.Token = os.Getenv("CONSUL_TOKEN") } if m.token != "" { writeOpts.Token = m.token } if m.dc != "" { writeOpts.Datacenter = m.dc } return writeOpts }
func (m *Meta) WriteOptions() *consulapi.WriteOptions { writeOpts := new(consulapi.WriteOptions) if m.token != "" { writeOpts.Token = m.token } if m.dc != "" { writeOpts.Datacenter = m.dc } return writeOpts }
func (c *Cmd) WriteOptions() *consulapi.WriteOptions { csl := c.consul writeOpts := new(consulapi.WriteOptions) if csl.token != "" { writeOpts.Token = csl.token } if csl.dc != "" { writeOpts.Datacenter = csl.dc } return writeOpts }