Documentation ¶
Index ¶
Constants ¶
View Source
const ( ProjectTypeBinary = "binary" ProjectTypeNode = "node" ProjectTypeNPM = "npm" ProjectTypeGo = "go" ProjectTypeRust = "rust" ProjectTypePython = "python" ProjectTypeDocker = "docker" ProjectTypeCPP = "c++" ProjectTypeStatic = "static" )
Variables ¶
View Source
var ( ErrOrganizationNotExist = errors.New("Organization does not exist") ErrRepositoryNotExist = errors.New("Repository does not exist") ErrReleaseNotExist = errors.New("Release does not exist") )
View Source
var ProjectTypes = []string{ ProjectTypeBinary, ProjectTypeNode, ProjectTypeNPM, ProjectTypeGo, ProjectTypeRust, ProjectTypePython, ProjectTypeDocker, ProjectTypeCPP, ProjectTypeStatic, }
Functions ¶
This section is empty.
Types ¶
type CoreAPI ¶
type CoreAPI interface { OrganizationAPI RegistryAPI ReleaseAPI RepositoryAPI StorageAPI Close() }
CoreAPI defines the high-level interface for Valist.
type Organization ¶
type OrganizationAPI ¶
type OrganizationAPI interface { GetOrganization(context.Context, common.Hash) (*Organization, error) GetOrganizationMeta(context.Context, cid.Cid) (*OrganizationMeta, error) CreateOrganization(context.Context, *OrganizationMeta) (*valist.ValistOrgCreated, error) VoteOrganizationThreshold(context.Context, common.Hash, *big.Int) (*valist.ValistVoteThresholdEvent, error) }
type OrganizationMeta ¶
type RegistryAPI ¶
type ReleaseAPI ¶
type ReleaseAPI interface { GetRelease(context.Context, common.Hash, string, string) (*Release, error) GetLatestRelease(context.Context, common.Hash, string) (*Release, error) ListReleaseTags(common.Hash, string, *big.Int, *big.Int) ReleaseTagIterator ListReleases(common.Hash, string, *big.Int, *big.Int) ReleaseIterator VoteRelease(context.Context, common.Hash, string, *Release) (*valist.ValistVoteReleaseEvent, error) }
type ReleaseIterator ¶
type ReleaseTagIterator ¶
type Repository ¶
type RepositoryAPI ¶
type RepositoryAPI interface { GetRepository(context.Context, common.Hash, string) (*Repository, error) GetRepositoryMeta(context.Context, cid.Cid) (*RepositoryMeta, error) CreateRepository(context.Context, common.Hash, string, *RepositoryMeta) (*valist.ValistRepoCreated, error) SetRepositoryMeta(context.Context, common.Hash, string, *RepositoryMeta) (*valist.ValistMetaUpdate, error) VoteRepositoryThreshold(context.Context, common.Hash, string, *big.Int) (*valist.ValistVoteThresholdEvent, error) }
type RepositoryMeta ¶
type StorageAPI ¶
type StorageAPI interface { // ReadFile returns the contents of the file with the given CID. ReadFile(context.Context, cid.Cid) ([]byte, error) // WriteFile writes the given file contents and returns its CID. WriteFile(context.Context, []byte) (cid.Cid, error) // WriteFilePath writes the contents of the given file path and returns its CID. WriteFilePath(context.Context, string) (cid.Cid, error) // WriteDirEntries writes the given list of files into a directory and returns its CID. WriteDirEntries(context.Context, string, []string) (cid.Cid, error) }
type TransactorAPI ¶
type TransactorAPI interface { CreateOrganizationTx(*bind.TransactOpts, cid.Cid) (*types.Transaction, error) LinkOrganizationNameTx(*bind.TransactOpts, common.Hash, string) (*types.Transaction, error) CreateRepositoryTx(*bind.TransactOpts, common.Hash, string, string) (*types.Transaction, error) VoteReleaseTx(*bind.TransactOpts, common.Hash, string, *Release) (*types.Transaction, error) SetRepositoryMetaTx(*bind.TransactOpts, common.Hash, string, string) (*types.Transaction, error) VoteOrganizationThresholdTx(*bind.TransactOpts, common.Hash, *big.Int) (*types.Transaction, error) VoteRepositoryThresholdTx(*bind.TransactOpts, common.Hash, string, *big.Int) (*types.Transaction, error) }
TransactorAPI defines functions to abstract blockchain transactions. TODO: Maybe this can return []*types.Log instead of *types.Transaction and handle waiting and log parsing?
Click to show internal directories.
Click to hide internal directories.