mirror of
https://github.com/pomerium/pomerium.git
synced 2025-04-30 02:46:30 +02:00
- gofumpt everything - fix TLS MinVersion to be at least 1.2 - add octal syntax - remove newlines - fix potential decompression bomb in ecjson - remove implicit memory aliasing in for loops. Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
29 lines
738 B
Go
29 lines
738 B
Go
// Package mock implements a mock implementation of MarshalUnmarshaler.
|
|
package mock
|
|
|
|
import (
|
|
"github.com/pomerium/pomerium/internal/encoding"
|
|
)
|
|
|
|
var (
|
|
_ encoding.MarshalUnmarshaler = &Encoder{}
|
|
_ encoding.Marshaler = &Encoder{}
|
|
_ encoding.Unmarshaler = &Encoder{}
|
|
)
|
|
|
|
// Encoder MockCSRFStore is a mock implementation of Cipher.
|
|
type Encoder struct {
|
|
MarshalResponse []byte
|
|
MarshalError error
|
|
UnmarshalError error
|
|
}
|
|
|
|
// Marshal is a mock implementation of Encoder.
|
|
func (mc Encoder) Marshal(i interface{}) ([]byte, error) {
|
|
return mc.MarshalResponse, mc.MarshalError
|
|
}
|
|
|
|
// Unmarshal is a mock implementation of Encoder.
|
|
func (mc Encoder) Unmarshal(s []byte, i interface{}) error {
|
|
return mc.UnmarshalError
|
|
}
|