mediatypes

package
v1.2.3 Latest Latest
Warning

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

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

Documentation

Overview

Package mediatypes provides functions to validate data against mediatype.

It allows developers to register custom mediatypes, that can be used in json-schema for validation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, mt MediaType)

Register registers MediaType object for given mediaType.

Types

type MediaType

type MediaType func([]byte) error

The MediaType type is a function, that validates whether the bytes represent data of given mediaType.

func Get

func Get(name string) (MediaType, bool)

Get returns MediaType object for given mediaType, if found.

Jump to

Keyboard shortcuts

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