dtcpv1

package
v0.0.0-...-d4762d9 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONST_DTCP_Version_v1 = "1.0"

	CONST_DTCP_Type_Object   = "object"
	CONST_DTCP_Type_Relation = "relation"

	CONST_DTCP_Status_Created = "created"
	CONST_DTCP_Status_Updated = "updated"
	CONST_DTCP_Status_Deleted = "deleted"

	CONST_DTCP_Tag_Account                = "account"
	CONST_DTCP_Tag_Group                  = "group"
	CONST_DTCP_Tag_Group_member           = "group_member"
	CONST_DTCP_Tag_Group_member_whitelist = "group_member_whitelist"
	CONST_DTCP_Tag_Group_share            = "group_share"
	CONST_DTCP_Tag_Article                = "article"
	CONST_DTCP_Tag_Image                  = "image"
	CONST_DTCP_Tag_Share_report           = "share_report"
	CONST_DTCP_Tag_Share_like             = "share_like"
	CONST_DTCP_Tag_Share_comment          = "share_comment"

	CONST_DTCP_ApplicationStatus_Pending  = "pending"
	CONST_DTCP_ApplicationStatus_Approved = "approved"
	CONST_DTCP_ApplicationStatus_Declined = "declined"

	CONST_DTCP_Group_AllowJoin_Type_all         = "all"
	CONST_DTCP_Group_AllowJoin_Type_application = "application"

	CONST_DTCP_Group_AllowPost_Type_all         = "all"
	CONST_DTCP_Group_AllowPost_Type_none        = "none"
	CONST_DTCP_Group_AllowPost_Type_application = "application"

	CONST_DTCP_Group_AccountRole_Type_Owner     = "owner"
	CONST_DTCP_Group_AccountRole_Type_Member    = "member"
	CONST_DTCP_Group_AccountRole_Type_Applicant = "applicant"
	CONST_DTCP_Group_AccountRole_Type_None      = "none"

	CONST_DTCP_Image_Type_Image = "image"
	CONST_DTCP_Image_Type_Audio = "audio"
	CONST_DTCP_Image_Type_Video = "video"
)
View Source
const (
	//
	License_Fields_Derivation = "derivation"
	License_Fields_Commercial = "commercial"

	// Whether Derivation is allowed.
	License_Derivative_y  = "y"
	License_Derivative_n  = "n"
	License_Derivative_sa = "sa" // for share-alike

	// Whether commercial usage is allowed
	License_Commercial_y = "y"
	License_Commercial_n = "n"
)

Variables

This section is empty.

Functions

func HashValue

func HashValue(value []byte) string

func NewDna

func NewDna(signature string) (string, error)

func NewId

func NewId(Dna string) (string, error)

Types

type AccountGet

type AccountGet struct {
	Id            string             `json:"id"`                 // Account id.
	Address       string             `json:"address"`            // Account address.
	Title         string             `json:"title"`              // Account name.
	Abstract      string             `json:"abstract,omitempty"` // Description.
	Avatar        string             `json:"avatar,omitempty"`   // An image id used for avatar.
	Creator       *AccountGetCreator `json:"creator"`            // Creator of the sub account.
	Created       int                `json:"created"`            // Account creation time. Unix timestamp.
	Updated       int                `json:"updated"`            // Account last updating time. Unix timestamp.
	Extra         *AccountGetExtra   `json:"extra,omitempty"`    // Extra metadata.
	Signature     string             `json:"signature"`          // Metadata signature.
	Dna           string             `json:"dna"`                // DNA of the account.
	Credits       int                `json:"credits"`            // Current credits.
	TransactionId string             `json:"transaction_id"`     // Latest transaction id.
}

get

type AccountGetCreator

type AccountGetCreator struct {
	AccountId   string `json:"account_id"`   // Root account id.
	AccountName string `json:"account_name"` // Root account name.
}

type AccountGetExtra

type AccountGetExtra struct {
	Hash string `json:"hash"` // In the case of proof of existence of secret data. The hash can be filled in this field.
}

type AccountPost

type AccountPost struct {
	Version   string              `json:"version"` // DTCP version. Fixed to "1.0".
	Atype     string              `json:"type"`    // Fixed to "object".
	Tag       string              `json:"tag"`     // Fixed to "account".
	Name      string              `json:"name"`    // Name.
	Address   string              `json:"address"`
	Abstract  string              `json:"abstract,omitempty"`  // Description.
	Avatar    string              `json:"avatar,omitempty"`    // An image id used for avatar.
	Creator   *AccountPostCreator `json:"creator,omitempty"`   // Creator. Required when creating sub account.
	Created   int                 `json:"created"`             // Account creation time. Unix timestamp.
	Extra     *AccountPostExtra   `json:"extra,omitempty"`     // Extra metadata.
	Status    string              `json:"status"`              // Fixed to "created".
	Signature string              `json:"signature,omitempty"` // Metadata signature.
}

func NewAccountPost

func NewAccountPost() *AccountPost

type AccountPostCreator

type AccountPostCreator struct {
	AccountId    string `json:"account_id"`     // Root account id.
	SubAccountId string `json:"sub_account_id"` // Sub account id. This id is provided by the third-party application. Usually the id in the application system is used directly.
}

type AccountPostExtra

type AccountPostExtra struct {
	Hash string `json:"hash"`
}

type AccountPut

type AccountPut struct {
	Version   string             `json:"version"`             // DTCP version. Fixed to "1.0".
	Atype     string             `json:"type"`                // Fixed to "object".
	Tag       string             `json:"tag"`                 // Fixed to "account".
	ParentDna string             `json:"parent_dna"`          // The latest DNA of the account
	Updated   int                `json:"creaupdatedted"`      // Updating time. Unix timestamp.
	Name      string             `json:"name"`                // Name.
	Abstract  string             `json:"abstract,omitempty"`  // Description.
	Avatar    string             `json:"avatar,omitempty"`    // An image id used for avatar.
	Creator   *AccountPutCreator `json:"creator,omitempty"`   // Creator. Required when creating sub account.
	Extra     *AccountPutExtra   `json:"extra,omitempty"`     // Extra metadata.
	Status    string             `json:"status"`              // Fixed to "updated".
	Signature string             `json:"signature,omitempty"` // Metadata signature.
}

func NewAccountPut

func NewAccountPut() *AccountPut

type AccountPutCreator

type AccountPutCreator struct {
	AccountId    string `json:"account_id"`     // Root account id.
	SubAccountId string `json:"sub_account_id"` // Sub account id. This id is provided by the third-party application. Usually the id in the application system is used directly.
}

type AccountPutExtra

type AccountPutExtra struct {
	Hash string `json:"hash"`
}

type ContentCommentGet

type ContentCommentGet struct {
	Id            string                    `json:"id"`             // Comment id.
	SrcId         string                    `json:"src_id"`         // Account id.
	DestId        string                    `json:"dest_id"`        // Share id.
	Hp            int                       `json:"hp"`             // hp value
	Creator       *ContentCommentGetCreator `json:"creator"`        // Creator.
	Created       int                       `json:"created"`        // Comment created time. Unix timestamp.
	Updated       int                       `json:"updated"`        // Comment created time. Unix timestamp.
	Extra         *ContentCommentGetExtra   `json:"extra"`          // Extra metadata.
	Signature     string                    `json:"signature"`      // Metadata signature.
	TransactionId string                    `json:"transaction_id"` // Latest transaction id.
}

Get

type ContentCommentGetCreator

type ContentCommentGetCreator struct {
	AccountId      string `json:"account_id"`                 // Account id. Root account id in the case of Sub account posting.
	AccountName    string `json:"account_name"`               // Account name.
	SubAccountId   string `json:"sub_account_id,omitempty"`   // Sub account id. Refer to Sub account for details.
	SubAccountName string `json:"sub_account_name,omitempty"` // Sub account name.
}

type ContentCommentGetExtra

type ContentCommentGetExtra struct {
	Content  string              `json:"content"`  // Comment content.
	Comments []ContentCommentGet `json:"comments"` // Replying comments overview.
}

type ContentCommentPost

type ContentCommentPost struct {
	Version   string                     `json:"version"`             // DTCP version. Fixed to "1.0"
	Atype     string                     `json:"type"`                // Fixed to "relation".
	Tag       string                     `json:"tag"`                 // Fixed to "share_comment".
	SrcId     string                     `json:"src_id"`              // Account id.
	DestId    string                     `json:"dest_id"`             // Share id.
	Hp        int                        `json:"hp"`                  // hp value
	Creator   *ContentCommentPostCreator `json:"creator"`             // Creator.
	Created   int                        `json:"created"`             // Comment created time. Unix timestamp.
	Status    string                     `json:"status"`              // Fixed to "created".
	Extra     *ContentCommentPostExtra   `json:"extra"`               // Extra metadata.
	Signature string                     `json:"signature,omitempty"` // Metadata signature.
}

func NewContentCommentPost

func NewContentCommentPost() *ContentCommentPost

type ContentCommentPostCreator

type ContentCommentPostCreator struct {
	AccountId      string `json:"account_id"`                 // Account id. Root account id in the case of Sub account posting.
	SubAccountId   string `json:"sub_account_id,omitempty"`   // Sub account id. Refer to Sub account for details.
	SubAccountName string `json:"sub_account_name,omitempty"` // Sub account name. For fast creation of new sub accounts.
}

type ContentCommentPostExtra

type ContentCommentPostExtra struct {
	ParentCommentId string `json:"parent_comment_id,omitempty"` // Parent comment id.
	Content         string `json:"content"`                     // Comment content.
	ContentHash     string `json:"content_hash"`                // Lowercase hex string of the SHA256 hash of the raw content.
}

type ContentCommentPut

type ContentCommentPut struct {
	Version   string                    `json:"version"`             // DTCP version. Fixed to "1.0".
	Atype     string                    `json:"type"`                // Fixed to "relation".
	Tag       string                    `json:"tag"`                 // Fixed to "share_comment".
	ParentDna string                    `json:"parent_dna"`          // Latest comment DNA.
	Creator   *ContentCommentPutCreator `json:"creator"`             // Creator.
	Updated   int                       `json:"updated"`             // Comment updated time. Unix timestamp.
	Status    string                    `json:"status"`              // Fixed to "updated".
	Extra     *ContentCommentPutExtra   `json:"extra"`               // Extra metadata.
	Signature string                    `json:"signature,omitempty"` // Metadata signature.
}

func NewContentCommentPut

func NewContentCommentPut() *ContentCommentPut

type ContentCommentPutCreator

type ContentCommentPutCreator struct {
	AccountId    string `json:"account_id"`               // Account id. Root account id in the case of Sub account posting.
	SubAccountId string `json:"sub_account_id,omitempty"` // Sub account id. Refer to Sub account for details.
}

type ContentCommentPutExtra

type ContentCommentPutExtra struct {
	Content     string `json:"content"`      //Comment content.
	ContentHash string `json:"content_hash"` // Lowercase hex string of the SHA256 hash of the raw content.
}

type ContentGet

type ContentGet struct {
	Id            string             `json:"id"`                // Content id.
	Tag           string             `json:"tag"`               // Content tag. Currently "article", "image" are supported.
	Title         string             `json:"title"`             // Content title.
	Creator       *ContentGetCreator `json:"creator"`           // Creator of the content.
	Abstract      string             `json:"abstract"`          // Content abstract.
	Language      string             `json:"language"`          // Content language. RFC4646 defined locales such as "en-US"
	Category      string             `json:"category"`          // Content categories. Comma separated words list.
	Created       int                `json:"created"`           // Content creation time. Unix timestamp.
	Updated       int                `json:"updated"`           // Content last updating time. Unix timestamp.
	Content       string             `json:"content"`           // Content URI. In the case of IPFS, a link starts with "ipfs://"
	ContentHash   string             `json:"content_hash"`      // Lowercase hex string of the SHA256 hash of the raw content.
	License       *License           `json:"license,omitempty"` // Content authorization license.
	Signature     string             `json:"signature"`         // Metadata signature.
	Dna           string             `json:"dna"`               // Content DNA.
	Extra         *ContentGetExtra   `json:"extra"`             // Extra content metadata.
	TransactionId string             `json:"transaction_id"`    // Transaction id.
}

Get

type ContentGetCreator

type ContentGetCreator struct {
	AccountId      string `json:"account_id"`                 // Account id. Root account id in the case of Sub account posting.
	AccountName    string `json:"account_name"`               // Account name. Root account name in the case of Sub account posting.
	SubAccountId   string `json:"sub_account_id,omitempty"`   // Sub account id. Refer to Sub account for details.
	SubAccountName string `json:"sub_account_name,omitempty"` // Sub account name.
}

type ContentGetExtra

type ContentGetExtra struct {
	Ext        string                   `json:"ext,omitempty"`     // Image format, such as 'png', 'jpg'. Image only.
	Width      int                      `json:"width,omitempty"`   // Image width in pixels. Image only.
	Height     int                      `json:"height,omitempty"`  // Image height in pixels. Image only.
	Size       int                      `json:"size,omitempty"`    // Image size in bytes. Image only.
	PstTotal   decimal.Decimal          `json:"pst_total"`         // Total PST earned.
	PstUpdated int                      `json:"pst_updated"`       // Last PST updated time. Unix timestamp.
	Objects    []ContentGetExtraObjects `json:"objects,omitempty"` // A list of images, videos, audios contained in the content. Article only.
}

type ContentGetExtraObject

type ContentGetExtraObject struct {
	Ext    string `json:"ext,omitempty"`    // Image format, such as 'png', 'jpg'. Image only.
	Width  int    `json:"width,omitempty"`  // Image width in pixels. Image only.
	Height int    `json:"height,omitempty"` // Image height in pixels. Image only.
	Size   int    `json:"size,omitempty"`   // Image size in bytes. Image only.
}

type ContentGetExtraObjects

type ContentGetExtraObjects struct {
	Id    string                 `json:"id"`    // Object id.
	Atype string                 `json:"type"`  // "image", "audio" or "video".
	Extra *ContentGetExtraObject `json:"extra"` // Extra metadata.
}

type ContentLikeDelete

type ContentLikeDelete struct {
	Version   string `json:"version"`             // DTCP version. Fixed to "1.0".
	Atype     string `json:"type"`                // Fixed to "relation".
	Tag       string `json:"tag"`                 // Fixed to "share_like".
	ParentDna string `json:"parent_dna"`          // Latest DNA of the like.
	Updated   int    `json:"updated"`             // Like updated time. Unix timestamp.
	Status    string `json:"status"`              // Fixed to "deleted".
	Signature string `json:"signature,omitempty"` // Metadata signature.
}

func NewContentLikeDelete

func NewContentLikeDelete() *ContentLikeDelete

type ContentLikeGet

type ContentLikeGet struct {
	Id            string                 `json:"id"`             // Like id.
	SrcId         string                 `json:"src_id"`         // Account id.
	DestId        string                 `json:"dest_id"`        // Share id.
	Hp            int                    `json:"hp"`             // hp value.
	Creator       *ContentLikeGetCreator `json:"creator"`        // Creator.
	Created       int                    `json:"created"`        // Like created time. Unix timestamp.
	Updated       int                    `json:"updated"`        // Like updated time. Unix timestamp.
	Dna           string                 `json:"dna"`            // Like DNA.
	Signature     string                 `json:"signature"`      // Metadata signature.
	TransactionId string                 `json:"transaction_id"` // Latest transaction id.
}

Get

type ContentLikeGetCreator

type ContentLikeGetCreator struct {
	AccountId      string `json:"account_id"`                 // Account id. Root account id in the case of Sub account posting.
	AccountName    string `json:"account_name"`               // Account name.
	SubAccountId   string `json:"sub_account_id,omitempty"`   // Sub account id. Refer to Sub account for details.
	SubAccountName string `json:"sub_account_name,omitempty"` // Sub account name.
}

type ContentLikePost

type ContentLikePost struct {
	Version   string                  `json:"version"`             // DTCP version. Fixed to "1.0".
	Atype     string                  `json:"type"`                // Fixed to "relation".
	Tag       string                  `json:"tag"`                 // Fixed to "share_like".
	SrcId     string                  `json:"src_id"`              // Account id.
	DestId    string                  `json:"dest_id"`             // Share id.
	Hp        int                     `json:"hp"`                  // hp value. Greater than or equal to zero.
	Creator   *ContentLikePostCreator `json:"creator"`             // Creator.
	Created   int                     `json:"created"`             // Like created time. Unix timestamp.
	Status    string                  `json:"status"`              // Fixed to "created".
	Signature string                  `json:"signature,omitempty"` // Metadata signature.
}

func NewContentLikePost

func NewContentLikePost() *ContentLikePost

type ContentLikePostCreator

type ContentLikePostCreator struct {
	AccountId      string `json:"account_id"`                 // Account id. Root account id in the case of Sub account posting.
	SubAccountId   string `json:"sub_account_id,omitempty"`   // Sub account id. Refer to Sub account for details.
	SubAccountName string `json:"sub_account_name,omitempty"` // Sub account name. For fast creation of new sub accounts.
}

type ContentPost

type ContentPost struct {
	Version     string              `json:"version"`             // DTCP version. Fixed to "1.0".
	Atype       string              `json:"type"`                // Fixed to "object".
	Tag         string              `json:"tag"`                 // Content type. Currently "article", "image" are supported.
	Title       string              `json:"title"`               // Content title.
	Creator     *ContentPostCreator `json:"creator"`             // Creator.
	Abstract    string              `json:"abstract"`            // Content abstract.
	Language    string              `json:"language"`            // Content language. RFC4646 defined locales such as "en-US"
	Category    string              `json:"category"`            // Content categories. Comma separated words list.
	Created     int                 `json:"created"`             // Content creation time. Unix timestamp.
	Content     string              `json:"content"`             // Raw content in base64 encoded format.
	ContentHash string              `json:"content_hash"`        // Lowercase hex string of the SHA256 hash of the raw content.
	License     *License            `json:"license,omitempty"`   // Content authorization license. "none" is used if empty.
	Status      string              `json:"status"`              // Fixed to "created".
	Signature   string              `json:"signature,omitempty"` // Metadata signature.
}

func NewContentPost_Aritcle

func NewContentPost_Aritcle() *ContentPost

func NewContentPost_Image

func NewContentPost_Image() *ContentPost

type ContentPostCreator

type ContentPostCreator struct {
	AccountId      string `json:"account_id"`                 // Account id. Root account id in the case of Sub account posting.
	SubAccountId   string `json:"sub_account_id,omitempty"`   // Sub account id. Refer to Sub account for details.
	SubAccountName string `json:"sub_account_name,omitempty"` // Sub account name. For fast creation of new sub accounts.
}

type ContentPut

type ContentPut struct {
	Version     string   `json:"version"`             // DTCP version. Fixed to "1.0".
	Atype       string   `json:"type"`                // Fixed to "object".
	Tag         string   `json:"tag"`                 // Content type. Currently "article", "image" are supported.
	ParentDna   string   `json:"parent_dna"`          // Latest DNA of the content.
	Status      string   `json:"status"`              // Fixed to "updated".
	Updated     int      `json:"updated"`             // Content updating time. Unix timestamp.
	Title       string   `json:"title"`               // Content title.
	Abstract    string   `json:"abstract"`            // Content abstract.
	Category    string   `json:"category"`            // Content categories. Comma separated words list.
	Content     string   `json:"content"`             // Raw content in base64 encoded format.
	ContentHash string   `json:"content_hash"`        // Lowercase hex string of the SHA256 hash of the raw content.
	License     *License `json:"license"`             // Content authorization license. "none" is used if empty.
	Signature   string   `json:"signature,omitempty"` // Metadata signature.
}

func NewContentPut_Aritcle

func NewContentPut_Aritcle() *ContentPut

func NewContentPut_Iamge

func NewContentPut_Iamge() *ContentPut

type ContentReportGet

type ContentReportGet struct {
	Version       string                   `json:"version"`             // DTCP version. Fixed to "1.0".
	Atype         string                   `json:"type"`                // Fixed to "relation".
	Tag           string                   `json:"tag"`                 // Fixed to "share_report".
	SrcId         string                   `json:"src_id"`              // Account id.
	DestId        string                   `json:"dest_id"`             // Share id.
	Creator       *ContentReportGetCreator `json:"creator"`             // Creator.
	Created       int                      `json:"created"`             // Report created time. Unix timestamp.
	Updated       int                      `json:"updated"`             //Report updated time. Unix timestamp.
	Extra         *ContentReportGetExtra   `json:"extra"`               // Extra metadata.
	Signature     string                   `json:"signature,omitempty"` // Metadata signature.
	TransactionId string                   `json:"transaction_id"`      // Latest transaction id.
}

Get

type ContentReportGetCreator

type ContentReportGetCreator struct {
	AccountId      string `json:"account_id"`                 // Account id. Root account id in the case of Sub account posting.
	AccountName    string `json:"account_name"`               // Account name.
	SubAccountId   string `json:"sub_account_id,omitempty"`   // Sub account id. Refer to Sub account for details.
	SubAccountName string `json:"sub_account_name,omitempty"` // Sub account name. For fast creation of new sub accounts.
}

type ContentReportGetExtra

type ContentReportGetExtra struct {
	Content      string `json:"content"`       // base64 encoded report content.
	ContentHash  string `json:"content_hash"`  // Lowercase hex string of the SHA256 hash of the raw content.
	ReportType   string `json:"report_type"`   // Report type.
	ReportStatus string `json:"report_status"` // Fixed to "pending".
}

type ContentReportPost

type ContentReportPost struct {
	Version   string                    `json:"version"`             // DTCP version. Fixed to "1.0".
	Atype     string                    `json:"type"`                // Fixed to "relation".
	Tag       string                    `json:"tag"`                 // Fixed to "share_report".
	SrcId     string                    `json:"src_id"`              // Account id.
	DestId    string                    `json:"dest_id"`             // Share id.
	Creator   *ContentReportPostCreator `json:"creator"`             // Creator.
	Created   int                       `json:"created"`             // Report created time. Unix timestamp.
	Status    string                    `json:"status"`              // Fixed to "created".
	Extra     *ContentReportPostExtra   `json:"extra"`               // Extra metadata.
	Signature string                    `json:"signature,omitempty"` // Metadata signature.
}

func NewContentReportPost

func NewContentReportPost() *ContentReportPost

type ContentReportPostCreator

type ContentReportPostCreator struct {
	AccountId      string `json:"account_id"`                 // Account id. Root account id in the case of Sub account posting.
	SubAccountId   string `json:"sub_account_id,omitempty"`   // Sub account id. Refer to Sub account for details.
	SubAccountName string `json:"sub_account_name,omitempty"` // Sub account name. For fast creation of new sub accounts.
}

type ContentReportPostExtra

type ContentReportPostExtra struct {
	Content      string `json:"content"`       // base64 encoded report content.
	ContentHash  string `json:"content_hash"`  // Lowercase hex string of the SHA256 hash of the raw content.
	ReportType   string `json:"report_type"`   // Report type.
	ReportStatus string `json:"report_status"` // Fixed to "pending".
}

type GroupGet

type GroupGet struct {
	Id            string           `json:"id"`             // Group id.
	Title         string           `json:"title"`          // Group title.
	Creator       *GroupGetCreator `json:"creator"`        // Creator.
	Avatar        string           `json:"avatar"`         // An image id used for avatar.
	Abstract      string           `json:"abstract"`       // Group introduction.
	Language      string           `json:"language"`       // Group language. RFC4646 defined locales such as "en-US"
	Category      string           `json:"category"`       // Group categories. Comma separated words list.
	Created       int              `json:"created"`        // Group creation time. Unix timestamp.
	Updated       int              `json:"updated"`        // Group last updating time. Unix timestamp.
	Extra         *GroupGetExtra   `json:"extra"`          // Extra metadata.
	Signature     string           `json:"signature"`      // Metadata signature.
	Dna           string           `json:"dna"`            // Group DNA.
	TransactionId string           `json:"transaction_id"` // Latest transaction id.
}

Get

type GroupGetCreator

type GroupGetCreator struct {
	AccountId      string `json:"account_id"`                 // Root account id.
	AccountName    string `json:"account_name"`               // Root account name.
	SubAccountId   string `json:"sub_account_id,omitempty"`   // Sub account id. Refer to Sub account for details.
	SubAccountName string `json:"sub_account_name,omitempty"` // Sub account name.
}

type GroupGetExtra

type GroupGetExtra struct {
	AllowJoin    string       `json:"allow_join"`             // Joining group control. "all" or "application".
	AllowPost    string       `json:"allow_post"`             // Posting control. "all", "none", "application".
	MembersTotal int          `json:"members_total"`          // Total members number.
	SharesTotal  int          `json:"shares_total"`           // Total shares number.
	AccountRole  string       `json:"account_role,omitempty"` // Member status of current account. "owner", "member", "applicant" or "none".
	Members      []AccountGet `json:"members"`                // Members overview. An array of account id.
}

type GroupMemberAppPostCreator

type GroupMemberAppPostCreator struct {
	AccountId      string `json:"account_id"`                 // Account id. Root account id in the case of Sub account posting.
	SubAccountId   string `json:"sub_account_id,omitempty"`   // Sub account id. Refer to Sub account for details.
	SubAccountName string `json:"sub_account_name,omitempty"` // Sub account name. For fast creation of new sub accounts.
}

type GroupMemberAppPostExtra

type GroupMemberAppPostExtra struct {
	ApplicationStatus string `json:"application_status"` // For group requiring application. Fill "pending".
	ApplicationExpire int    `json:"application_expire"` // Application expiration time.
}

type GroupMemberAppPutCreator

type GroupMemberAppPutCreator struct {
	AccountId    string `json:"account_id"`               // Account id. Root account id in the case of Sub account posting.
	SubAccountId string `json:"sub_account_id,omitempty"` // Sub account id. Refer to Sub account for details.
}

type GroupMemberAppPutExtra

type GroupMemberAppPutExtra struct {
	ApplicationStatus string `json:"application_status"` // "approved" or "declined".
}

type GroupMemberApplicationPost

type GroupMemberApplicationPost struct {
	Version   string                     `json:"version"`             // DTCP version. Fixed to "1.0".
	Atype     string                     `json:"type"`                // Fixed to "relation".
	Tag       string                     `json:"tag"`                 // Fixed to "group_member".
	SrcId     string                     `json:"src_id"`              // Account id. Root account id in the case of Sub account.
	DestId    string                     `json:"dest_id"`             // Group id.
	Created   int                        `json:"created"`             // Member joining time. Unix timestamp.
	Creator   *GroupMemberAppPostCreator `json:"creator"`             // Creator. Group owner.
	Status    string                     `json:"status"`              // Fixed to "created".
	Extra     *GroupMemberAppPostExtra   `json:"extra,omitempty"`     // Extra metadata.
	Signature string                     `json:"signature,omitempty"` // Metadata signature.
}

created

func NewGroupMemberApplicationPost

func NewGroupMemberApplicationPost() *GroupMemberApplicationPost

type GroupMemberApplicationPut

type GroupMemberApplicationPut struct {
	Version   string                    `json:"version"`             // DTCP version. Fixed to "1.0".
	Atype     string                    `json:"type"`                // Fixed to "relation".
	Tag       string                    `json:"tag"`                 // Fixed to "group_member".
	ParentDna string                    `json:"parent_dna"`          // Latest group member DNA.
	Status    string                    `json:"status"`              // Fixed to "updated".
	Updated   int                       `json:"updated"`             // Member updating time. Unix timestamp.
	Creator   *GroupMemberAppPutCreator `json:"creator"`             // Creator. Group owner.
	Extra     *GroupMemberAppPutExtra   `json:"extra"`               // Extra metadata.
	Signature string                    `json:"signature,omitempty"` // Metadata signature.
}

updated

func NewGroupMemberApplicationPut

func NewGroupMemberApplicationPut() *GroupMemberApplicationPut

type GroupMemberDelete

type GroupMemberDelete struct {
	Version   string                    `json:"version"`    // DTCP version. Fixed to "1.0".
	Atype     string                    `json:"type"`       // Fixed to "relation".
	Tag       string                    `json:"tag"`        // Fixed to "group_member".
	ParentDna string                    `json:"parent_dna"` // Latest group member DNA.
	Status    string                    `json:"status"`     // "deleted".
	Updated   int                       `json:"updated"`    // Member quiting time. Unix timestamp.
	Creator   *GroupMemberDeleteCreator `json:"creator"`    // Creator.
	Signature string                    `json:"signature"`  // Metadata signature.
}

Delete

func NewGroupMemberDelete

func NewGroupMemberDelete() *GroupMemberDelete

type GroupMemberDeleteCreator

type GroupMemberDeleteCreator struct {
	AccountId    string `json:"account_id"`               // Account id. Root account id in the case of Sub account posting.
	SubAccountId string `json:"sub_account_id,omitempty"` // Sub account id. Refer to Sub account for details.
}

type GroupMemberGet

type GroupMemberGet struct {
	Id            string                 `json:"id"`              // Group member id.
	SrcId         string                 `json:"src_id"`          // Account id. Root account id in the case of Sub account.
	DestId        string                 `json:"dest_id"`         // Group id.
	Creator       *GroupMemberGetCreator `json:"creator"`         // Creator.
	Created       int                    `json:"created"`         // Member joining time. Unix timestamp.
	Updated       int                    `json:"updated"`         // Member updating time. Unix timestamp.
	Extra         *GroupMemberGetExtra   `json:"extra,omitempty"` // Extra metadata.
	Signature     string                 `json:"signature"`       // Metadata signature.
	Dna           string                 `json:"dna"`             // Group member DNA.
	TransactionId string                 `json:"transaction_id"`  // Latest transaction id.
	Account       *AccountGet            `json:"account"`         // Related member account.
}

Get

type GroupMemberGetCreator

type GroupMemberGetCreator struct {
	AccountId      string `json:"account_id"`                 // Account id. Root account id in the case of Sub account posting.
	AccountName    string `json:"account_name"`               // Account name.
	SubAccountId   string `json:"sub_account_id,omitempty"`   // Sub account id. Refer to Sub account for details.
	SubAccountName string `json:"sub_account_name,omitempty"` // Sub account name. For fast creation of new sub accounts.
}

type GroupMemberGetExtra

type GroupMemberGetExtra struct {
	ApplicationStatus string `json:"application_status"` // "pending", "approved" or "declined".
}

type GroupMemberPost

type GroupMemberPost struct {
	Version   string                  `json:"version"`             // DTCP version. Fixed to "1.0".
	Atype     string                  `json:"type"`                // Fixed to "relation".
	Tag       string                  `json:"tag"`                 // Fixed to "group_member".
	SrcId     string                  `json:"src_id"`              // Account id. Root account id in the case of Sub account.
	DestId    string                  `json:"dest_id"`             // Group id.
	Creator   *GroupMemberPostCreator `json:"creator"`             // Creator.
	Created   int                     `json:"created"`             // Member joining time. Unix timestamp.
	Status    string                  `json:"status"`              // Fixed to "created".
	Extra     *GroupMemberPostExtra   `json:"extra,omitempty"`     // Extra metadata.
	Signature string                  `json:"signature,omitempty"` // Metadata signature.
}

func NewGroupMemberPost

func NewGroupMemberPost() *GroupMemberPost

type GroupMemberPostCreator

type GroupMemberPostCreator struct {
	AccountId      string `json:"account_id"`                 // Account id. Root account id in the case of Sub account posting.
	SubAccountId   string `json:"sub_account_id,omitempty"`   // Sub account id. Refer to Sub account for details.
	SubAccountName string `json:"sub_account_name,omitempty"` // Sub account name. For fast creation of new sub accounts.
}

type GroupMemberPostExtra

type GroupMemberPostExtra struct {
	ApplicationStatus string `json:"application_status"` // For group requiring application. Fill "pending".
	ApplicationExpire int    `json:"application_expire"` // Application expiration time.
}

type GroupMemberPut

type GroupMemberPut struct {
	Version   string                 `json:"version"`             // DTCP version. Fixed to "1.0".
	Atype     string                 `json:"type"`                // Fixed to "relation".
	Tag       string                 `json:"tag"`                 // Fixed to "group_member".
	ParentDna string                 `json:"parent_dna"`          // Latest group member DNA.
	Status    string                 `json:"status"`              // Fixed to "updated".
	Updated   int                    `json:"updated"`             // Member updating time. Unix timestamp.
	Creator   *GroupMemberPutCreator `json:"creator"`             // Creator. Group owner.
	Extra     *GroupMemberPutExtra   `json:"extra"`               // Extra metadata.
	Signature string                 `json:"signature,omitempty"` // Metadata signature.
}

func NewGroupMemberPut

func NewGroupMemberPut() *GroupMemberPut

type GroupMemberPutCreator

type GroupMemberPutCreator struct {
	AccountId    string `json:"account_id"`               // 	Account id. Root account id in the case of Sub account posting.
	SubAccountId string `json:"sub_account_id,omitempty"` // Sub account id. Refer to Sub account for details.
}

type GroupMemberPutExtra

type GroupMemberPutExtra struct {
	ApplicationStatus string `json:"application_status"` // "approved" or "declined".
}

type GroupMemberWhiteGetCreator

type GroupMemberWhiteGetCreator struct {
	AccountId      string `json:"account_id"`
	AccountName    string `json:"account_name"`
	SubAccountId   string `json:"sub_account_id,omitempty"`
	SubAccountName string `json:"sub_account_name,omitempty"`
}

type GroupMemberWhiteGetExtra

type GroupMemberWhiteGetExtra struct {
	ApplicationStatus string `json:"application_status"`
}

type GroupMemberWhitePostCreator

type GroupMemberWhitePostCreator struct {
	AccountId      string `json:"account_id"`                 // Account id. Root account id in the case of Sub account posting.
	SubAccountId   string `json:"sub_account_id,omitempty"`   // Sub account id. Refer to Sub account for details.
	SubAccountName string `json:"sub_account_name,omitempty"` // Sub account name. For fast creation of new sub accounts.
}

type GroupMemberWhitePostExtra

type GroupMemberWhitePostExtra struct {
	ApplicationStatus string `json:"application_status"` // Fixed to "pending".
}

type GroupMemberWhitePutCreator

type GroupMemberWhitePutCreator struct {
	AccountId    string `json:"account_id"`               // Account id. Root account id in the case of Sub account posting.
	SubAccountId string `json:"sub_account_id,omitempty"` // Sub account id. Refer to Sub account for details.
}

type GroupMemberWhitePutExtra

type GroupMemberWhitePutExtra struct {
	ApplicationStatus string `json:"application_status"` // "approved" or "declined".
}

type GroupMemberWhitelistDelete

type GroupMemberWhitelistDelete struct {
	Version   string                             `json:"version"`    // DTCP version. Fixed to "1.0".
	Atype     string                             `json:"type"`       // Fixed to "relation".
	Tag       string                             `json:"tag"`        // Fixed to "group_member_whitelist".
	ParentDna string                             `json:"parent_dna"` // Latest whitelist DNA.
	Status    string                             `json:"status"`     // Fixed to "deleted".
	Updated   int                                `json:"updated"`    // Whitelist updating time. Unix timestamp.
	Creator   *GroupMemberWhitelistDeleteCreator `json:"creator"`    // Creator.
	Signature string                             `json:"signature"`  // Metadata signature.
}

detele

func NewGroupMemberWhitelistDelete

func NewGroupMemberWhitelistDelete() *GroupMemberWhitelistDelete

type GroupMemberWhitelistDeleteCreator

type GroupMemberWhitelistDeleteCreator struct {
	AccountId    string `json:"account_id"`               // Account id. Root account id in the case of Sub account posting.
	SubAccountId string `json:"sub_account_id,omitempty"` // Sub account id. Refer to Sub account for details.
}

type GroupMemberWhitelistGet

type GroupMemberWhitelistGet struct {
	Id        string                      `json:"id"`                  // Group member id.
	SrcId     string                      `json:"src_id"`              // Account id. Root account id in the case of Sub account.
	DestId    string                      `json:"dest_id"`             // Group id.
	Creator   *GroupMemberWhiteGetCreator `json:"creator"`             // Creator.
	Created   int                         `json:"created"`             // Member joining time. Unix timestamp.
	Status    string                      `json:"status"`              // Fixed to "created".
	Extra     *GroupMemberWhiteGetExtra   `json:"extra,omitempty"`     // Extra metadata.
	Signature string                      `json:"signature,omitempty"` // Metadata signature.
	DNA       string                      `json:"dna"`                 // Group member DNA.
	Account   *AccountGet                 `json:"account"`             // Related member account.
}

get

type GroupMemberWhitelistPost

type GroupMemberWhitelistPost struct {
	Version   string                       `json:"version"`             // DTCP version. Fixed to "1.0".
	Atype     string                       `json:"type"`                // Fixed to "relation".
	Tag       string                       `json:"tag"`                 // Fixed to "group_member_whitelist".
	SrcId     string                       `json:"src_id"`              // Account id.
	DestId    string                       `json:"dest_id"`             // Group id.
	Creator   *GroupMemberWhitePostCreator `json:"creator"`             // Creator.
	Created   int                          `json:"created"`             // Whitelist creating time. Unix timestamp.
	Status    string                       `json:"status"`              // Fixed to "created".
	Extra     *GroupMemberWhitePostExtra   `json:"extra"`               // Extra metadata.
	Signature string                       `json:"signature,omitempty"` // Metadata signature.
}

created

func NewGroupMemberWhitelistPost

func NewGroupMemberWhitelistPost() *GroupMemberWhitelistPost

type GroupMemberWhitelistPut

type GroupMemberWhitelistPut struct {
	Version   string                      `json:"version"`             // DTCP version. Fixed to "1.0".
	Atype     string                      `json:"type"`                // Fixed to "relation".
	Tag       string                      `json:"tag"`                 // Fixed to "group_member_whitelist".
	ParentDna string                      `json:"parent_dna"`          // Latest whitelist DNA.
	Status    string                      `json:"status"`              // Fixed to "updated".
	Updated   int                         `json:"updated"`             // Whitelist updating time. Unix timestamp.
	Creator   *GroupMemberWhitePutCreator `json:"creator"`             // Creator.
	Extra     *GroupMemberWhitePutExtra   `json:"extra"`               // Extra metadata.
	Signature string                      `json:"signature,omitempty"` // Metadata signature.
}

updated

func NewGroupMemberWhitelistPut

func NewGroupMemberWhitelistPut() *GroupMemberWhitelistPut

type GroupPost

type GroupPost struct {
	Version   string            `json:"version"`             // DTCP version. Fixed to "1.0"
	Atype     string            `json:"type"`                // Fixed to "object".
	Tag       string            `json:"tag"`                 // Fixed to "group".
	Title     string            `json:"title"`               // Group title.
	Creator   *GroupPostCreator `json:"creator"`             // Creator.
	Avatar    string            `json:"avatar"`              // An image id used for avatar.
	Abstract  string            `json:"abstract"`            // Group introduction.
	Language  string            `json:"language"`            // Group language. RFC4646 defined locales such as "en-US"
	Category  string            `json:"category"`            // Group categories. Comma separated words list.
	Created   int               `json:"created"`             // Group creation time. Unix timestamp.
	Extra     *GroupPostExtra   `json:"extra"`               // Extra metadata.
	Status    string            `json:"status"`              // Fixed to "created".
	Signature string            `json:"signature,omitempty"` // Metadata signature.
}

func NewGroupPost

func NewGroupPost() *GroupPost

type GroupPostCreator

type GroupPostCreator struct {
	AccountId      string `json:"account_id"`                 // Account id. Root account id in the case of Sub account posting.
	SubAccountId   string `json:"sub_account_id,omitempty"`   // Sub account id. Refer to Sub account for details.
	SubAccountName string `json:"sub_account_name,omitempty"` // Sub account name. For fast creation of new sub accounts.
}

type GroupPostExtra

type GroupPostExtra struct {
	AllowJoin          string   `json:"allow_join"`                     // Joining group control. "all" or "application".
	AllowPost          string   `json:"allow_post"`                     // Posting control. "all", "none", "application".
	AllowPostWhitelist []string `json:"allow_post_whitelist,omitempty"` //An array containing account_ids that can always post in the group.
}

type GroupPut

type GroupPut struct {
	Version   string         `json:"version"`             // DTCP version. Fixed to "1.0".
	Atype     string         `json:"type"`                // Fixed to "object".
	Tag       string         `json:"tag"`                 // Fixed to "group".
	ParentDna string         `json:"parent_dna"`          // The latest DNA of the group.
	Status    string         `json:"status"`              // Fixed to "updated".
	Updated   int            `json:"updated"`             // Group update time. Unix timestamp.
	Title     string         `json:"title,omitempty"`     // Group title.
	Avatar    string         `json:"avatar,omitempty"`    // An image id used for avatar.
	Abstract  string         `json:"abstract,omitempty"`  // Group introduction.
	Language  string         `json:"language,omitempty"`  // Group language. RFC4646 defined locales such as "en-US"
	Category  string         `json:"category,omitempty"`  // Group categories. Comma separated words list.
	Extra     *GroupPutExtra `json:"extra,omitempty"`     // Extra metadata.
	Signature string         `json:"signature,omitempty"` // Metadata signature.
}

func NewGroupPut

func NewGroupPut() *GroupPut

type GroupPutExtra

type GroupPutExtra struct {
	AllowJoin string `json:"allow_join"` // Joining group control. "all" or "application".
	AllowPost string `json:"allow_post"` // Posting control. "all", "none", "application".
}

type GroupShareAppPut

type GroupShareAppPut struct {
	Version   string                   `json:"version"`             // DTCP version. Fixed to "1.0"
	Atype     string                   `json:"type"`                // Fixed to "relation".
	Tag       string                   `json:"tag"`                 // Fixed to "group_share".
	ParentDna string                   `json:"parent_dna"`          // Latest share DNA.
	Status    string                   `json:"status"`              // Fixed to "updated".
	Updated   int                      `json:"updated"`             // Share updated time. Unix timestamp.
	Creator   *GroupShareAppPutCreator `json:"creator"`             // Creator. Group owner
	Extra     *GroupShareAppPutExtra   `json:"extra"`               // Extra metadata.
	Signature string                   `json:"signature,omitempty"` // Metadata signature.
}

func NewGroupShareAppPut

func NewGroupShareAppPut() *GroupShareAppPut

type GroupShareAppPutCreator

type GroupShareAppPutCreator struct {
	AccountId    string `json:"account_id"`               // Account id. Root account id in the case of Sub account posting.
	SubAccountId string `json:"sub_account_id,omitempty"` // Sub account id. Refer to Sub account for details.
}

type GroupShareAppPutExtra

type GroupShareAppPutExtra struct {
	ApplicationStatus string `json:"application_status"` // "approved" or "declined"
}

type GroupShareDelete

type GroupShareDelete struct {
	Version   string                   `json:"version"`           // DTCP version. Fixed to "1.0".
	Atype     string                   `json:"type"`              // Fixed to "relation".
	Tag       string                   `json:"tag"`               // Fixed to "group_share".
	ParentDna string                   `json:"parent_dna"`        // Latest share DNA.
	Status    string                   `json:"status"`            // Fixed to "deleted".
	Updated   int                      `json:"updated"`           // Share updated time. Unix timestamp.
	Creator   *GroupShareDeleteCreator `json:"creator,omitempty"` // Creator. Group owner.
	Signature string                   `json:"signature"`         // Metadata signature.
}

Delete

func NewGroupShareDelete

func NewGroupShareDelete() *GroupShareDelete

type GroupShareDeleteCreator

type GroupShareDeleteCreator struct {
	AccountId    string `json:"account_id"`               // Account id. Root account id in the case of Sub account posting.
	SubAccountId string `json:"sub_account_id,omitempty"` // Sub account id. Refer to Sub account for details.
}

type GroupSharePost

type GroupSharePost struct {
	Version   string                 `json:"version"`             // DTCP version. Fixed to "1.0".
	Atype     string                 `json:"type"`                // Fixed to "relation".
	Tag       string                 `json:"tag"`                 // Fixed to "group_share".
	SrcId     string                 `json:"src_id"`              // Content id.
	DestId    string                 `json:"dest_id"`             // Group id.
	Hp        int                    `json:"hp"`                  // hp value. Greater than or equal to zero.
	Creator   *GroupSharePostCreator `json:"creator"`             // Creator.
	Created   int                    `json:"created"`             // Share created time. Unix timestamp.
	Status    string                 `json:"status"`              // Fixed to "created".
	Extra     *GroupSharePostExtra   `json:"extra,omitempty"`     // Extra metadata.
	Signature string                 `json:"signature,omitempty"` // Metadata signature.
}

func NewGroupSharePost

func NewGroupSharePost() *GroupSharePost

type GroupSharePostCreator

type GroupSharePostCreator struct {
	AccountId      string `json:"account_id"`                 // Account id. Root account id in the case of Sub account posting.
	SubAccountId   string `json:"sub_account_id,omitempty"`   // Sub account id. Refer to Sub account for details.
	SubAccountName string `json:"sub_account_name,omitempty"` // Sub account name. For fast creation of new sub accounts.
}

type GroupSharePostExtra

type GroupSharePostExtra struct {
	ShareId           string `json:"share_id,omitempty"`           // Parent share id.
	ApplicationStatus string `json:"application_status,omitempty"` // For group requiring application. Fill "pending".
	ApplicationExpire int    `json:"application_expire,omitempty"` // Application expiration time.
}

type License

type License struct {
	Name       string           `json:"name"`
	Version    string           `json:"version"`
	Parameters []LicenseSubject `json:"parameters"`
}

type LicensePrice

type LicensePrice struct {
	Name  string
	Value decimal.Decimal
}

func NewLicensePST

func NewLicensePST(value decimal.Decimal) *LicensePrice

func NewLicensePrice

func NewLicensePrice(value decimal.Decimal) *LicensePrice

type LicenseSubject

type LicenseSubject struct {
	Name  string
	Value string
}

func NewLicenseCommercial

func NewLicenseCommercial(value string) *LicenseSubject

func NewLicenseCommercial_n

func NewLicenseCommercial_n(value string) *LicenseSubject

func NewLicenseCommercial_y

func NewLicenseCommercial_y() *LicenseSubject

func NewLicenseDerivative

func NewLicenseDerivative(value string) *LicenseSubject

func NewLicenseDerivative_n

func NewLicenseDerivative_n() *LicenseSubject

func NewLicenseDerivative_sa

func NewLicenseDerivative_sa() *LicenseSubject

func NewLicenseDerivative_y

func NewLicenseDerivative_y() *LicenseSubject

type Share

type Share struct {
	Id            string        `json:"id"`              // Share id.
	SrcId         string        `json:"src_id"`          // Content id.
	DestId        string        `json:"dest_id"`         // Group id.
	Creator       *ShareCreator `json:"creator"`         // Creator.
	Created       int           `json:"created"`         // Share created time. Unix timestamp.
	Updated       int           `json:"updated"`         // Share updated time. Unix timestamp.
	Extra         *ShareExtra   `json:"extra,omitempty"` // Extra metadata.
	Signature     string        `json:"signature"`       // Metadata signature.
	Dna           string        `json:"dna"`             // Latest share DNA.
	TransactionId string        `json:"transaction_id"`  // Latest transaction id.
}

type ShareCreator

type ShareCreator struct {
	AccountId      string `json:"account_id"`                 // Account id. Root account id in the case of Sub account posting.
	AccountName    string `json:"account_name"`               // Account name.
	SubAccountId   string `json:"sub_account_id,omitempty"`   // Sub account id. Refer to Sub account for details.
	SubAccountName string `json:"sub_account_name,omitempty"` // Sub account name.
}

type ShareExtra

type ShareExtra struct {
	ShareId       string            `json:"share_id"`           // Parent share id.
	LikesTotal    int               `json:"likes_total"`        // Total likes number.
	CommentsTotal int               `json:"comments_total"`     // Total comments number.
	SharesTotal   int               `json:"shares_total"`       // Total shares number.
	PstTotal      decimal.Decimal   `json:"pst_total"`          // Total PST earned.
	PstUpdated    int               `json:"pst_updated"`        // Last PST updated time. Unix timestamp.
	IsLiked       bool              `json:"is_liked,omitempty"` // Whether current account liked this share.
	Content       *ContentGet       `json:"content"`            // Share related content.
	Report        *ContentReportGet `json:"report,omitempty"`   // Report metadata.
	Hp            int               `json:"hp"`                 // hp value.
}

type SystemParametersGet

type SystemParametersGet struct {
	LockAmountContent     decimal.Decimal // Token lock amount for posting content.
	LockPeriodContent     int             // Token lock period in seconds for posting content.
	LockAmountGroupJoin   decimal.Decimal // Token lock amount for joining group.
	LockAmountGroupCreate decimal.Decimal // Token lock amount for creating group.
	ConsumeAmountReport   decimal.Decimal // Token consumed amount for report share.
}

Jump to

Keyboard shortcuts

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