mimetype

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: BSD-3-Clause Imports: 4 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MIME_name = map[int32]string{
		0: "UNSPECIFIED",

		1: "TEXT_PLAIN",
		2: "TEXT_CSV",
		3: "TEXT_HTML",
		4: "TEXT_CALENDAR",

		50: "APPLICATION_JSON",

		51:   "APPLICATION_JSON_LD",
		52:   "APPLICATION_JSON_LINES",
		53:   "APPLICATION_UBJSON",
		54:   "APPLICATION_BSON",
		100:  "APPLICATION_XML",
		101:  "APPLICATION_ATOM",
		252:  "APPLICATION_MSGPACK",
		253:  "APPLICATION_PARQUET",
		254:  "APPLICATION_AVRO",
		255:  "APPLICATION_PROTOBUF",
		512:  "APPLICATION_PDF",
		513:  "APPLICATION_JAVA_ARCHIVE",
		514:  "APPLICATION_PYTHON_PICKLE",
		1000: "USER_SPECIFIED0",
		1001: "USER_SPECIFIED1",
		1002: "USER_SPECIFIED2",
		1003: "USER_SPECIFIED3",
		1004: "USER_SPECIFIED4",
		1005: "USER_SPECIFIED5",
		1006: "USER_SPECIFIED6",
		1007: "USER_SPECIFIED7",
		1008: "USER_SPECIFIED8",
		1009: "USER_SPECIFIED9",
	}
	MIME_value = map[string]int32{
		"UNSPECIFIED":               0,
		"UNKNOWN":                   0,
		"TEXT_PLAIN":                1,
		"TEXT_CSV":                  2,
		"TEXT_HTML":                 3,
		"TEXT_CALENDAR":             4,
		"APPLICATION_OCTET_STREAM":  0,
		"APPLICATION_JSON":          50,
		"APPLICATION_JSON_UTF8":     50,
		"APPLICATION_JSON_LD":       51,
		"APPLICATION_JSON_LINES":    52,
		"APPLICATION_UBJSON":        53,
		"APPLICATION_BSON":          54,
		"APPLICATION_XML":           100,
		"APPLICATION_ATOM":          101,
		"APPLICATION_MSGPACK":       252,
		"APPLICATION_PARQUET":       253,
		"APPLICATION_AVRO":          254,
		"APPLICATION_PROTOBUF":      255,
		"APPLICATION_PDF":           512,
		"APPLICATION_JAVA_ARCHIVE":  513,
		"APPLICATION_PYTHON_PICKLE": 514,
		"USER_SPECIFIED0":           1000,
		"USER_SPECIFIED1":           1001,
		"USER_SPECIFIED2":           1002,
		"USER_SPECIFIED3":           1003,
		"USER_SPECIFIED4":           1004,
		"USER_SPECIFIED5":           1005,
		"USER_SPECIFIED6":           1006,
		"USER_SPECIFIED7":           1007,
		"USER_SPECIFIED8":           1008,
		"USER_SPECIFIED9":           1009,
	}
)

Enum value maps for MIME.

View Source
var File_mimetype_v1beta1_mimetype_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type MIME

type MIME int32

MIME stands for multipurpose internet mail extensions and is a standardized method for defining the formatting of files and data of different types. In Ensign, the mimetype is used to identify and deserialize event data.

Typically, mimetypes are strings, e.g. "application/json" and can even flexibly define encodings such as "application/json; charset=utf-8"; these ensure that mimetypes are flexible and can be extended without changing protocols. However, using string encoding for events results in a lot of duplication and data size should be as small as possible when there are numerous events in the system.

To reduce the size of event messages, this package defines mimetypes as an enum. This ensures that only 4 bytes maximum are used for the mimetype, but also means that the mimetypes are not as flexible and adding new mimetypes requires adding enum values to this package. If your mimetype is not listed here, please submit a pull request to ensign to get it added!

const (
	MIME_UNSPECIFIED MIME = 0
	MIME_UNKNOWN     MIME = 0
	// Default value for textual files that are human-readable and do not contain binary data.
	MIME_TEXT_PLAIN MIME = 1
	// Plain text data-containing types
	MIME_TEXT_CSV      MIME = 2
	MIME_TEXT_HTML     MIME = 3
	MIME_TEXT_CALENDAR MIME = 4
	// Default value for all non-text data types (alias for UNSPECIFIED)
	MIME_APPLICATION_OCTET_STREAM MIME = 0
	// Application data-containing types
	MIME_APPLICATION_JSON       MIME = 50
	MIME_APPLICATION_JSON_UTF8  MIME = 50
	MIME_APPLICATION_JSON_LD    MIME = 51
	MIME_APPLICATION_JSON_LINES MIME = 52
	MIME_APPLICATION_UBJSON     MIME = 53
	MIME_APPLICATION_BSON       MIME = 54
	MIME_APPLICATION_XML        MIME = 100
	MIME_APPLICATION_ATOM       MIME = 101
	// Binary application data-containing types
	MIME_APPLICATION_MSGPACK  MIME = 252
	MIME_APPLICATION_PARQUET  MIME = 253
	MIME_APPLICATION_AVRO     MIME = 254
	MIME_APPLICATION_PROTOBUF MIME = 255
	// Other miscellaneous application types
	MIME_APPLICATION_PDF           MIME = 512
	MIME_APPLICATION_JAVA_ARCHIVE  MIME = 513
	MIME_APPLICATION_PYTHON_PICKLE MIME = 514
	// User-specified mimetypes allow the user to distinguish mimetypes in their
	// applications without specifically setting a mimetype.
	MIME_USER_SPECIFIED0 MIME = 1000
	MIME_USER_SPECIFIED1 MIME = 1001
	MIME_USER_SPECIFIED2 MIME = 1002
	MIME_USER_SPECIFIED3 MIME = 1003
	MIME_USER_SPECIFIED4 MIME = 1004
	MIME_USER_SPECIFIED5 MIME = 1005
	MIME_USER_SPECIFIED6 MIME = 1006
	MIME_USER_SPECIFIED7 MIME = 1007
	MIME_USER_SPECIFIED8 MIME = 1008
	MIME_USER_SPECIFIED9 MIME = 1009
)

func (MIME) Descriptor

func (MIME) Descriptor() protoreflect.EnumDescriptor

func (MIME) Enum

func (x MIME) Enum() *MIME

func (MIME) EnumDescriptor deprecated

func (MIME) EnumDescriptor() ([]byte, []int)

Deprecated: Use MIME.Descriptor instead.

func (MIME) Number

func (x MIME) Number() protoreflect.EnumNumber

func (MIME) String

func (x MIME) String() string

func (MIME) Type

func (MIME) Type() protoreflect.EnumType

Jump to

Keyboard shortcuts

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