base64

package
v0.16.0-rc.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2016 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package base64 provides a byte slice type that marshals into json as a raw (no padding) base64url value.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Value

type Value []byte

Value is a base64url encoded json object,

func NewValue

func NewValue(b []byte) *Value

NewValue returns a pointer to a Value, cast from the given byte slice. This is a convenience function, handling the address creation that a direct cast would not allow.

func NewValueFromString added in v0.15.0

func NewValueFromString(encoded string) (*Value, error)

NewValueFromString returns a Value containing the decoded data in encoded.

func (*Value) MarshalJSON

func (bv *Value) MarshalJSON() ([]byte, error)

MarshalJSON returns the ba64url encoding of bv for JSON representation.

func (*Value) String added in v0.15.0

func (bv *Value) String() string

func (*Value) UnmarshalJSON

func (bv *Value) UnmarshalJSON(b []byte) error

UnmarshalJSON sets bv to the bytes represented in the base64url encoding b.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL