types

package
v0.0.0-...-9a3f633 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: MPL-2.0 Imports: 9 Imported by: 0

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")
)

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 LinkOrgNameResult

type LinkOrgNameResult struct {
	OrgID common.Hash
	Name  string
	Err   error
}

type Organization

type Organization struct {
	ID            common.Hash
	Threshold     *big.Int
	ThresholdDate *big.Int
	MetaCID       cid.Cid
}

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 OrganizationMeta struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

type RegistryAPI

type RegistryAPI interface {
	GetOrganizationID(context.Context, string) (common.Hash, error)
	LinkOrganizationName(context.Context, common.Hash, string) (*registry.ValistRegistryMappingEvent, error)
}

type Release

type Release struct {
	Tag        string
	ReleaseCID cid.Cid
	MetaCID    cid.Cid
	Signers    []common.Address
}

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 ReleaseIterator interface {
	Next(context.Context) (*Release, error)
	ForEach(context.Context, func(*Release)) error
}

type ReleaseTagIterator

type ReleaseTagIterator interface {
	Next(context.Context) (string, error)
}

type Repository

type Repository struct {
	OrgID         common.Hash
	Threshold     *big.Int
	ThresholdDate *big.Int
	MetaCID       cid.Cid
}

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 RepositoryMeta struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	ProjectType string `json:"projectType"`
	Homepage    string `json:"homepage"`
	Repository  string `json:"repository"`
}

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?

Jump to

Keyboard shortcuts

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