common

package
v0.0.0-...-f7f3e2b Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LocalStoragePath = "nebin/storage"
	PaperPdfFileName = "paper.pdf"
)
View Source
const (
	UnknownStatus = iota
	ProcessingFailedStatus
	NotEnoughUniquenessStatus
	IsReadyForProcessingStatus
	InProgressStatus
	SuccessStatus
)
View Source
const (
	Network         = "network"
	DevNetwork      = "devnet"
	MainNetwork     = "mainnet-beta"
	Description     = "description"
	Mnemonic        = "secret_recovery_phrase"
	DerivationPath  = "derivation_path"
	NfrName         = "nft_name"
	NftSymbol       = "nft_symbol"
	NftUrl          = "nft_url"
	NftUploadMethod = "nft_upload_method"
	ApiKey          = "APIKeyID"
	ApiSecret       = "APISecretKey"
	Link            = "LINK"
)

blockchain

View Source
const (
	NftBaseUrl   = "https://api.theblockchainapi.com/"
	MintEndpoint = "v1/solana/nft"
)

blockchain endpoint

View Source
const (
	ImageBaseUrl = "https://api.imgbb.com/1/upload"
	Image        = "image"
	Key          = "key"
	Expiration   = "expiration"
)

nft image creator

View Source
const IpfsUrl = "https://ipfs.io/ipfs/"

IPFS

Variables

View Source
var CloserHandler = func(closer io.Closer) {
	if err := closer.Close(); err != nil {
		log.Print(err)
	}
}

Functions

This section is empty.

Types

type AnalysisResult

type AnalysisResult struct {
	Id              string
	Uniqueness      float64
	SimilarPapersId []string
}

type Author

type Author struct {
	Name          string `json:"name" bson:"name"`
	Surname       string `json:"surname" bson:"surname"`
	ScienceDegree string `json:"scienceDegree" bson:"scienceDegree"`
}

type NftResponse

type NftResponse struct {
	Id                   string `json:"id" bson:"id"`
	Mint                 string `json:"mint" bson:"mint"`
	MintRecoveryPhrase   string `json:"mintRecoveryPhrase" bson:"mintRecoveryPhrase"`
	TransactionSignature string `json:"transactionSignature" bson:"transactionSignature"`
}

type PaperMetadata

type PaperMetadata struct {
	Id               string   `json:"id" bson:"id"`
	Topic            string   `json:"topic" bson:"topic"`
	UploadDate       string   `json:"uploadDate" bson:"uploadDate"`
	Authors          []Author `json:"authors" bson:"authors"`
	PaperIpfsHash    string   `json:"paperIpfsHash,omitempty" bson:"paperIpfsHash,omitempty"`
	ReviewRating     string   `json:"reviewRating,omitempty" bson:"reviewRating,omitempty"`
	PaperUniqueness  string   `json:"paperUniqueness,omitempty" bson:"paperUniqueness,omitempty"`
	SimilarPapersNfr []string `json:"similarPapersNfr,omitempty" bson:"similarPapersNfr,omitempty"`
}

type PaperProcessingResult

type PaperProcessingResult struct {
	Id     string `json:"id"`
	Status int    `json:"status"`
	NFT    string `json:"NFT"`
}

type PaperShingles

type PaperShingles struct {
	Id                string   `json:"id" bson:"id"`
	Shingles          []uint32 `json:"shingles" bson:"shingles"`
	WordsInShingleCnt int      `json:"wordsInShingleCnt" bson:"wordsInShingleCnt"`
	HashAlgorithm     string   `json:"hashAlgorithm" bson:"hashAlgorithm"`
}

type ServiceAction

type ServiceAction = int
const (
	NewPaperUploadAction ServiceAction = iota
	GetPaperProcessingStatusAction
	GetPaperByHashAction
	GetPaperInfoByNFTAction
)

type ServiceTask

type ServiceTask struct {
	Action   ServiceAction
	Payload  interface{}
	ReturnCh chan<- interface{}
}

type UploadedPaper

type UploadedPaper struct {
	Id          string
	NftName     string
	NftSymbol   string
	Topic       string
	Description string
	Authors     []Author
	FilePath    string
}

Jump to

Keyboard shortcuts

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