github.com/GeniusesGroup/libgo@v0.0.0-20220929090155-5ff932cb408e/http/media-types.go (about) 1 /* For license and copyright information please see the LEGAL file in the code repository */ 2 3 package http 4 5 import ( 6 "github.com/GeniusesGroup/libgo/detail" 7 "github.com/GeniusesGroup/libgo/mediatype" 8 "github.com/GeniusesGroup/libgo/protocol" 9 ) 10 11 var ( 12 MediaType mediaType 13 MediaTypeRequest mediaTypeRequest 14 MediaTypeResponse mediaTypeResponse 15 ) 16 17 func init() { 18 MediaType.Init("application/http") 19 MediaType.SetDetail(protocol.LanguageEnglish, domainEnglish, 20 "Hypertext Transfer Protocol", 21 "An application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information", 22 "", 23 "", 24 []string{}) 25 26 MediaTypeRequest.Init("application/http; request") 27 MediaTypeRequest.SetDetail(protocol.LanguageEnglish, domainEnglish, "Hypertext Transfer Protocol Request", "", "", "", []string{}) 28 29 MediaTypeResponse.Init("application/http; response") 30 MediaTypeResponse.SetDetail(protocol.LanguageEnglish, domainEnglish, "Hypertext Transfer Protocol Response", "", "", "", []string{}) 31 } 32 33 type mediaType struct { 34 detail.DS 35 mediatype.MT 36 } 37 38 //libgo:impl protocol.MediaType 39 func (m *mediaType) FileExtension() string { return "http" } 40 func (m *mediaType) Status() protocol.SoftwareStatus { return protocol.Software_PreAlpha } 41 func (m *mediaType) ReferenceURI() string { 42 return "https://www.iana.org/assignments/media-types/application/http" 43 } 44 func (m *mediaType) IssueDate() protocol.Time { return nil } 45 func (m *mediaType) ExpiryDate() protocol.Time { return nil } 46 func (m *mediaType) ExpireInFavorOf() protocol.MediaType { return nil } 47 func (m *mediaType) Fields() []protocol.Field { return nil } 48 49 type mediaTypeRequest struct { 50 detail.DS 51 mediatype.MT 52 } 53 54 //libgo:impl protocol.MediaType 55 func (m *mediaTypeRequest) FileExtension() string { return "req.http" } 56 func (m *mediaTypeRequest) Status() protocol.SoftwareStatus { return protocol.Software_PreAlpha } 57 func (m *mediaTypeRequest) ReferenceURI() string { 58 return "https://www.iana.org/assignments/media-types/application/http" 59 } 60 func (m *mediaTypeRequest) IssueDate() protocol.Time { return nil } 61 func (m *mediaTypeRequest) ExpiryDate() protocol.Time { return nil } 62 func (m *mediaTypeRequest) ExpireInFavorOf() protocol.MediaType { return nil } 63 func (m *mediaTypeRequest) Fields() []protocol.Field { return nil } 64 65 type mediaTypeResponse struct { 66 detail.DS 67 mediatype.MT 68 } 69 70 //libgo:impl protocol.MediaType 71 func (m *mediaTypeResponse) FileExtension() string { return "res.http" } 72 func (m *mediaTypeResponse) Status() protocol.SoftwareStatus { return protocol.Software_PreAlpha } 73 func (m *mediaTypeResponse) ReferenceURI() string { 74 return "https://www.iana.org/assignments/media-types/application/http" 75 } 76 func (m *mediaTypeResponse) IssueDate() protocol.Time { return nil } 77 func (m *mediaTypeResponse) ExpiryDate() protocol.Time { return nil } 78 func (m *mediaTypeResponse) ExpireInFavorOf() protocol.MediaType { return nil } 79 func (m *mediaTypeResponse) Fields() []protocol.Field { return nil }