File: id.go

package info (click to toggle)
golang-github-go-macaroon-bakery-macaroonpb 1.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 124 kB
  • sloc: makefile: 2
file content (19 lines) | stat: -rw-r--r-- 503 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Package macaroonpb defines the serialization details of macaroon ids
// used in the macaroon-bakery.
package macaroonpb

import (
	"google.golang.org/protobuf/proto"
)

//go:generate  protoc --go_out . id.proto

// MarshalBinary implements encoding.BinaryMarshal.
func (id *MacaroonId) MarshalBinary() ([]byte, error) {
	return proto.Marshal(id)
}

// UnmarshalBinary implements encoding.UnmarshalBinary.
func (id *MacaroonId) UnmarshalBinary(data []byte) error {
	return proto.Unmarshal(data, id)
}