resource

package
v0.0.0-...-e495acf Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//TextType 文档类型
	TextType uint = 1 << iota
	//PictureType 图片类型
	PictureType
	//StreamingType 流数据(中转)类型
	StreamingType
)
View Source
const (
	//Base64Encoding Base64编码
	Base64Encoding uint = 1 << iota
	//AESEncoding AES加密编码
	AESEncoding
	//Plain 无编码
	Plain
)
View Source
const (
	//FileSystem 文件系统信息(通过文件系统获取信息)
	FileSystem uint = 1 << iota
	//URI URL信息
	URI
	//PlainContent 包含在数据内的信息
	PlainContent
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Descriptor

type Descriptor struct {
	// contains filtered or unexported fields
}

Descriptor 资源描述符

func DescriptorMustParse

func DescriptorMustParse(rdstring string) *Descriptor

DescriptorMustParse 文件描述符分离,无法分离时将会Panic

func (Descriptor) GetCodec

func (d Descriptor) GetCodec() uint64

GetCodec 获取编码信息

func (Descriptor) GetDescription

func (d Descriptor) GetDescription() string

GetDescription 获取描述

func (Descriptor) GetSource

func (d Descriptor) GetSource() uint64

GetSource 获取信息来源

func (Descriptor) GetType

func (d Descriptor) GetType() uint64

GetType 获取类型

type Resource

type Resource struct {
	ID            primitive.ObjectID `json:"_id" bson:"_id" xml:"_id"`                      //ID 数据唯一性标志
	DescriptorStr string             `json:"descriptor" xml:"descriptor" bson:"descriptor"` //DescriptorStr 描述信息 (A:B:C:D) A为数据类型(Audio, Video, Text...),B为编码方式加解密(BASE64/BASE32/AES...),支持多层,C为D代表的意义,即如何解析它,D为数据本身
	Sender        string             `json:"owner" xml:"owner" bson:"owner"`                //Sender 发送者
}

Resource 资源数据

func (Resource) BeforeInsert

func (r Resource) BeforeInsert()

BeforeInsert 加入数据库之前用的函数

func (Resource) TableName

func (r Resource) TableName() string

TableName 存储时候的表名/集合名称

Jump to

Keyboard shortcuts

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