MCPcopy
hub / github.com/grpc/grpc-go / Encode

Method Encode

examples/features/authz/token/token.go:38–45  ·  view source on GitHub ↗

Encode returns a base64 encoded version of the JSON representation of token.

()

Source from the content-addressed store, hash-verified

36
37// Encode returns a base64 encoded version of the JSON representation of token.
38func (t *Token) Encode() (string, error) {
39 barr, err := json.Marshal(t)
40 if err != nil {
41 return "", err
42 }
43 s := base64.StdEncoding.EncodeToString(barr)
44 return s, nil
45}
46
47// Decode updates the internals of Token using the passed in base64
48// encoded version of the JSON representation of token.

Callers 1

newCredentialsCallOptionFunction · 0.45

Calls 1

MarshalMethod · 0.65

Tested by

no test coverage detected