Documentation ¶
Overview ¶
Package buffer provides a very thin wrapper around []byte buffer called `Buffer`, to provide functionalities that are often used within the jwx related packages
Index ¶
- type Buffer
- func (b *Buffer) Accept(value interface{}) error
- func (b *Buffer) Base64Decode(v []byte) error
- func (b Buffer) Base64Encode() ([]byte, error)
- func (b Buffer) Bytes() []byte
- func (b Buffer) Len() int
- func (b Buffer) MarshalJSON() ([]byte, error)
- func (b Buffer) NData() []byte
- func (b *Buffer) SetBytes(b2 []byte)
- func (b *Buffer) UnmarshalJSON(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer []byte
Buffer wraps `[]byte` and provides functions that are often used in the jwx related packages. One notable difference is that while encoding/json marshalls `[]byte` using base64.StdEncoding, this module uses base64.RawURLEncoding as mandated by the spec
func FromBase64 ¶
FromBase64 constructs a new Buffer from a base64 encoded data
func (*Buffer) Base64Decode ¶
Base64Decode decodes the contents of the Buffer using base64.RawURLEncoding
func (Buffer) Base64Encode ¶
Base64Encode encodes the contents of the Buffer using base64.RawURLEncoding
func (Buffer) MarshalJSON ¶
MarshalJSON marshals the buffer into JSON format after encoding the buffer with base64.RawURLEncoding
func (Buffer) NData ¶
NData returns Datalen || Data, where Datalen is a 32 bit counter for the length of the following data, and Data is the octets that comprise the buffer data
func (*Buffer) UnmarshalJSON ¶
UnmarshalJSON unmarshals from a JSON string into a Buffer, after decoding it with base64.RawURLEncoding