media

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: LGPL-3.0 Imports: 0 Imported by: 1

Documentation

Overview

Package media provides an implementation for NDEF Payloads for media types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Payload

type Payload struct {
	MimeType string
	Payload  []byte
}

Payload is a wrapper to store a Payload

func New

func New(mimeType string, payload []byte) *Payload

New returns a pointer to a Payload type holding the given payload with the given type.

func (*Payload) Len

func (media *Payload) Len() int

Len is the length of the byte slice resulting of Marshaling this Payload.

func (*Payload) Marshal

func (media *Payload) Marshal() []byte

Marshal returns the bytes representing the payload

func (*Payload) String

func (media *Payload) String() string

String returns a string explaining that we are not sure how to print this type.

func (*Payload) Type

func (media *Payload) Type() string

Type returns the mime type of this payload.

func (*Payload) Unmarshal

func (media *Payload) Unmarshal(buf []byte)

Unmarshal parses a generic payload

Jump to

Keyboard shortcuts

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