Documentation
¶
Index ¶
- func MediaTypeFromMIME(contentType string) string
- type Service
- func (s *Service) BuildPlaceholder(mediaType string, path string, fileName string) string
- func (s *Service) DetectMIME(data []byte, fileName string) string
- func (s *Service) ExtensionFromMIME(contentType string) string
- func (s *Service) SaveInbound(_ context.Context, data []byte, ext string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MediaTypeFromMIME ¶
MediaTypeFromMIME maps a MIME type prefix to a media type string.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles media file operations: saving, MIME detection, placeholder building.
func NewService ¶
func NewService() *Service
NewService creates a Service with baseDir at ~/.openbee/media and ensures inbound/ exists.
func (*Service) BuildPlaceholder ¶
BuildPlaceholder builds a content placeholder string for embedding in message Content.
func (*Service) DetectMIME ¶
DetectMIME detects the MIME type from file content bytes, falling back to extension-based mapping.
func (*Service) ExtensionFromMIME ¶
ExtensionFromMIME maps a MIME type to a file extension (with leading dot).