File: export_test.go

package info (click to toggle)
golang-github-canonical-candid 1.12.3-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 3,016 kB
  • sloc: python: 1,903; sh: 235; makefile: 81
file content (28 lines) | stat: -rw-r--r-- 673 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright 2016 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.

package debug

import "github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery"

type (
	DebugAPIHandler *debugAPIHandler
	Cookie          cookie
)

var (
	New = newDebugAPIHandler
)

// DecodeCookie is a wrapper around decodeCookie that can be used for
// testing.
func DecodeCookie(k *bakery.KeyPair, s string) (*Cookie, error) {
	c, err := decodeCookie(k, s)
	return (*Cookie)(c), err
}

// EncodeCookie is a wrapper around encodeCookie that can be used for
// testing.
func EncodeCookie(k *bakery.KeyPair, c *Cookie) (string, error) {
	return encodeCookie(k, (*cookie)(c))
}