Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArweaveOperator ¶
func CreateArweaveOperator ¶
func CreateArweaveOperator(priKey, payCurrency string) *ArweaveOperator
type IArweaveOperator ¶
type IArweaveOperator interface { // Load // @Return content, json format LoadPage(arTxId string) (content string, err error) LoadDatabase(arTxId string) (content string, err error) LoadImage(arTxId string) (content string, err error) // Save SavePage(content string) (txId string, err error) SaveDatabase(content string) (txId string, err error) SaveImage(content string) (txId string, err error) }
IArweaveOperator
type IContentAnalyzer ¶
type IContentAnalyzer interface { // Covert2UploadContent Converting content from arweave to upload format CovertPage2UploadContent(srcContent string) (dstContent string, err error) }
IContentAnalyzer
type INotionOperator ¶
type INotionOperator interface { // Fetch // !MUST support recursive // @Pararm uuid, // @Return string, txId return by Arweave FetchPage(uuid string) (content string, err error) FetchDatabase(uuid string) (content string, err error) FetchImage(uuid string) (content string, err error) // Level 2 func // FetchChildBlocks, get subblocks FetchChildBlocks(parentId string) (content string, err error) // Upload content to notion // @Pararm parentId, uuid of parent page // @Return uuid, new uuid // @Return content, json format page content UploadPage(parentId, content string) (uuid string, err error) UploadDatabase(parentId, content string) (uuid string, err error) UploadImage(content string) (uuid string, err error) }
INotionOperator
type IOperator ¶
type IOperator interface { // Save2Ar fetch content from notion and upload to arweave // !MUST support recursive // @Pararm uuid, // @Return string, txId return by Arweave SavePage2Ar(uuid string) (arTxId string, err error) SaveDatabase2Ar(uuid string) (arTxId string, err error) SaveImage2Ar(uuid string) (arTxId string, err error) // LoadFromAr get content from arweave and upload to notion // @Pararm parentId, uuid of parent page // @Return uuid, new uuid // @Return content, json format page content LoadPageFromAr(parentId, arTxId string) (uuid string, err error) LoadDatabaseFromAr(parentId, arTxId string) (uuid string, err error) LoadImageFromAr(parentId, arTxId string) (uuid string, err error) }
type NotionOperator ¶
type NotionOperator struct {
// contains filtered or unexported fields
}
NotionOperator inherite INotionOperator
func CreateNotionOperator ¶
func CreateNotionOperator(auth string) *NotionOperator
Implementation of Notion interaction Inheritance INotionOperator
CreateNotionOperator
func (*NotionOperator) FetchPage ¶
func (n *NotionOperator) FetchPage(uuid string) (content string, err error)
Fetch page from notion, upload to arweave4 @Pararm uuid, page uuid @Return txId, txId return by Arweave
func (*NotionOperator) UploadPage ¶
func (n *NotionOperator) UploadPage(parentId string, page *types.ArweavePage) (uuid string, err error)
UploadPage uploading page content to notion @Pararm parentId, parent page uuid, where new page to be loaded @Pararm content, page content ,need convert to upload format @Return uuid, uuid of new page @Return content, new page content
type Operator ¶
type Operator struct { NotionOpter *NotionOperator ArOpter *ArweaveOperator }
Operator inherite IOperator
func CreateOperator ¶
func (*Operator) LoadPageFromAr ¶
LoadPageFromAr get page from arweave and upload to notion
Click to show internal directories.
Click to hide internal directories.