mime

package
v0.6.16 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: Apache-2.0 Imports: 9 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoveryMimeType

func DiscoveryMimeType(compression string) string

DiscoveryMimeType returns a MIME type for a Discovery description of an API.

func GUnzippedType added in v0.6.10

func GUnzippedType(mimeType string) string

GUnzippedType returns an equivalent uncompressed MIME type for a compressed type.

func IsDiscovery

func IsDiscovery(mimeType string) bool

IsDiscovery returns true if a MIME type represents a Google API Discovery document.

func IsGZipCompressed

func IsGZipCompressed(mimeType string) bool

IsGZipCompressed returns true if a MIME type represents a type compressed with GZip encoding.

func IsOpenAPIv2

func IsOpenAPIv2(mimeType string) bool

IsOpenAPIv2 returns true if a MIME type represents an OpenAPI v2 spec.

func IsOpenAPIv3

func IsOpenAPIv3(mimeType string) bool

IsOpenAPIv3 returns true if a MIME type represents an OpenAPI v3 spec.

func IsPrintableType

func IsPrintableType(mimeType string) bool

IsPrintableType returns true if the corresponding contents can be treated as a string.

func IsProto

func IsProto(mimeType string) bool

IsProto returns true if a MIME type represents a Protocol Buffers Language API description.

func IsYamlKind added in v0.6.13

func IsYamlKind(mimeType string) bool

func IsZipArchive

func IsZipArchive(mimeType string) bool

IsZipArchive returns true if a MIME type represents a type stored as a multifile Zip archive.

func KindForMimeType

func KindForMimeType(mimeType string) string

KindForMimeType returns the name to be used as the "kind" of an exported artifact.

func MessageForKind

func MessageForKind(kind string) (proto.Message, error)

MessageForKind returns an instance of the message that represents the specified kind.

func MessageForMimeType

func MessageForMimeType(mimeType string) (proto.Message, error)

MessageForMimeType returns an instance of the message that represents the specified MIME type.

func MessageTypeForMimeType

func MessageTypeForMimeType(protoType string) (string, error)

MessageTypeForMimeType returns the Protocol Buffer message type represented by a MIME type.

func MimeTypeForKind

func MimeTypeForKind(kind string) string

MimeTypeForKind returns the mime type that corresponds to a kind.

func MimeTypeForMessageType

func MimeTypeForMessageType(protoType string) string

MimeTypeForMessageType returns a MIME type that represents a Protocol Buffer message type.

func OpenAPIMimeType

func OpenAPIMimeType(compression, version string) string

OpenAPIMimeType returns a MIME type for an OpenAPI description of an API.

func ProtobufMimeType

func ProtobufMimeType(compression string) string

ProtobufMimeType returns a MIME type for a Protocol Buffers description of an API.

func YamlMimeTypeForKind added in v0.6.13

func YamlMimeTypeForKind(kind string) string

YamlMimeTypeForKind returns a YAML mime type that corresponds to a kind.

Types

This section is empty.

Jump to

Keyboard shortcuts

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