Documentation
¶
Index ¶
- Variables
- func DateFormat(str string) string
- func ImageExif(reader io.Reader) ([]exif.ExifTag, error)
- type Meta
- func (*Meta) Descriptor() ([]byte, []int)deprecated
- func (x *Meta) GetChannels() int32
- func (x *Meta) GetDatetime() string
- func (x *Meta) GetDuration() float64
- func (x *Meta) GetExtension() string
- func (x *Meta) GetHeight() int32
- func (x *Meta) GetSize() int64
- func (x *Meta) GetSubtype() string
- func (x *Meta) GetType() MetaType
- func (x *Meta) GetWidth() int32
- func (*Meta) ProtoMessage()
- func (x *Meta) ProtoReflect() protoreflect.Message
- func (x *Meta) Reset()
- func (x *Meta) String() string
- type MetaType
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MetaType_name = map[int32]string{ 0: "Unknown", 1: "Directory", 2: "Image", 3: "Video", 4: "Audio", 5: "Document", 6: "Archive", } MetaType_value = map[string]int32{ "Unknown": 0, "Directory": 1, "Image": 2, "Video": 3, "Audio": 4, "Document": 5, "Archive": 6, } )
Enum value maps for MetaType.
View Source
var ErrNotDir = errors.New("not a directory")
View Source
var File_meta_meta_proto protoreflect.FileDescriptor
View Source
var File_meta_meta_type_proto protoreflect.FileDescriptor
Functions ¶
func DateFormat ¶ added in v0.0.3
Example ¶
package main
import (
"fmt"
"github.com/xuender/fmeta/meta"
)
func main() {
fmt.Println(meta.DateFormat("2006/01/02 15:04:05"))
fmt.Println(meta.DateFormat("2006:01:02 15:04:05"))
}
Output: 2006-01-02 15:04:05 2006-01-02 15:04:05
Types ¶
type Meta ¶
type Meta struct {
Type MetaType `protobuf:"varint,1,opt,name=type,proto3,enum=meta.MetaType" json:"type,omitempty"`
Subtype string `protobuf:"bytes,2,opt,name=subtype,proto3" json:"subtype,omitempty"`
Extension string `protobuf:"bytes,3,opt,name=extension,proto3" json:"extension,omitempty"`
Datetime string `protobuf:"bytes,4,opt,name=datetime,proto3" json:"datetime,omitempty"`
Size int64 `protobuf:"varint,5,opt,name=size,proto3" json:"size,omitempty"`
Width int32 `protobuf:"varint,6,opt,name=width,proto3" json:"width,omitempty"`
Height int32 `protobuf:"varint,7,opt,name=height,proto3" json:"height,omitempty"`
Duration float64 `protobuf:"fixed64,8,opt,name=duration,proto3" json:"duration,omitempty"`
Channels int32 `protobuf:"varint,9,opt,name=channels,proto3" json:"channels,omitempty"`
// contains filtered or unexported fields
}
Meta message.
func DirMeta ¶
Example ¶
package main
import (
"fmt"
"github.com/xuender/fmeta/meta"
)
func main() {
val, err := meta.DirMeta(".")
fmt.Println(err)
fmt.Println(val.GetType())
_, err = meta.DirMeta("nofound")
fmt.Println(err)
}
Output: <nil> Directory stat nofound: no such file or directory
func FileMeta ¶
Example ¶
package main
import (
"fmt"
"github.com/xuender/fmeta/meta"
)
func main() {
val, err := meta.FileMeta("green.jpg")
fmt.Println(err)
fmt.Println(val.GetType())
}
Output: <nil> Image
func (*Meta) Descriptor
deprecated
func (*Meta) GetChannels ¶ added in v0.0.2
func (*Meta) GetDatetime ¶
func (*Meta) GetDuration ¶ added in v0.0.2
func (*Meta) GetExtension ¶
func (*Meta) GetSubtype ¶
func (*Meta) ProtoMessage ¶
func (*Meta) ProtoMessage()
func (*Meta) ProtoReflect ¶
func (x *Meta) ProtoReflect() protoreflect.Message
type MetaType ¶
type MetaType int32
MetaType message.
func (MetaType) Descriptor ¶
func (MetaType) Descriptor() protoreflect.EnumDescriptor
func (MetaType) EnumDescriptor
deprecated
func (MetaType) Number ¶
func (x MetaType) Number() protoreflect.EnumNumber
func (MetaType) Type ¶
func (MetaType) Type() protoreflect.EnumType
Click to show internal directories.
Click to hide internal directories.