hub.fastgit.org/hashicorp/consul.git@v1.4.5/command/kv/impexp/kvimpexp.go (about)

     1  package impexp
     2  
     3  import (
     4  	"encoding/base64"
     5  
     6  	"github.com/hashicorp/consul/api"
     7  )
     8  
     9  type Entry struct {
    10  	Key   string `json:"key"`
    11  	Flags uint64 `json:"flags"`
    12  	Value string `json:"value"`
    13  }
    14  
    15  func ToEntry(pair *api.KVPair) *Entry {
    16  	return &Entry{
    17  		Key:   pair.Key,
    18  		Flags: pair.Flags,
    19  		Value: base64.StdEncoding.EncodeToString(pair.Value),
    20  	}
    21  }