...

Package goautoneg

import "github.com/munnerz/goautoneg"
Overview
Index

Overview ▾

func Negotiate

func Negotiate(header string, alternatives []string) (content_type string)

Negotiate the most appropriate content_type given the accept header and a list of alternatives.

func ParseAccept

func ParseAccept(header string) acceptSlice

Parse an Accept Header string returning a sorted list of clauses

type Accept

Structure to represent a clause in an HTTP Accept Header

type Accept struct {
    Type, SubType string
    Q             float64
    Params        map[string]string
}