Documentation ¶
Index ¶
- Variables
- type Client
- func (client *Client) Close() error
- func (client *Client) CreateOrganization(ctx context.Context, meta *types.OrganizationMeta) (*valist.ValistOrgCreated, error)
- func (client *Client) CreateRepository(ctx context.Context, orgID common.Hash, name string, ...) (*valist.ValistRepoCreated, error)
- func (client *Client) GetLatestRelease(ctx context.Context, orgID common.Hash, repoName string) (*types.Release, error)
- func (client *Client) GetOrganization(ctx context.Context, id common.Hash) (*types.Organization, error)
- func (client *Client) GetOrganizationID(ctx context.Context, name string) (common.Hash, error)
- func (client *Client) GetOrganizationMeta(ctx context.Context, p string) (*types.OrganizationMeta, error)
- func (client *Client) GetRelease(ctx context.Context, orgID common.Hash, repoName, tag string) (*types.Release, error)
- func (client *Client) GetReleaseMeta(ctx context.Context, p string) (*types.ReleaseMeta, error)
- func (client *Client) GetRepository(ctx context.Context, orgID common.Hash, repoName string) (*types.Repository, error)
- func (client *Client) GetRepositoryMeta(ctx context.Context, p string) (*types.RepositoryMeta, error)
- func (client *Client) LinkOrganizationName(ctx context.Context, orgID common.Hash, name string) (*registry.ValistRegistryMappingEvent, error)
- func (client *Client) ListReleaseTags(orgID common.Hash, repoName string) types.ReleaseTagIterator
- func (client *Client) ListReleases(orgID common.Hash, repoName string) types.ReleaseIterator
- func (client *Client) ReadFile(ctx context.Context, fpath string) ([]byte, error)
- func (client *Client) ResolvePath(ctx context.Context, raw string) (types.ResolvedPath, error)
- func (client *Client) SetOrganizationMeta(ctx context.Context, orgID common.Hash, meta *types.OrganizationMeta) (*valist.ValistMetaUpdate, error)
- func (client *Client) SetRepositoryMeta(ctx context.Context, orgID common.Hash, name string, ...) (*valist.ValistMetaUpdate, error)
- func (client *Client) Signer() *signer.Signer
- func (client *Client) VoteOrganizationAdmin(ctx context.Context, orgID common.Hash, operation common.Hash, ...) (*valist.ValistVoteKeyEvent, error)
- func (client *Client) VoteOrganizationThreshold(ctx context.Context, orgID common.Hash, threshold *big.Int) (*valist.ValistVoteThresholdEvent, error)
- func (client *Client) VoteRelease(ctx context.Context, orgID common.Hash, repoName string, ...) (*valist.ValistVoteReleaseEvent, error)
- func (client *Client) VoteRepoDev(ctx context.Context, orgID common.Hash, repoName string, operation common.Hash, ...) (*valist.ValistVoteKeyEvent, error)
- func (client *Client) VoteRepositoryThreshold(ctx context.Context, orgID common.Hash, name string, threshold *big.Int) (*valist.ValistVoteThresholdEvent, error)
- func (client *Client) WriteFile(ctx context.Context, data []byte) (string, error)
- type Options
- type ReleaseIterator
- type ReleaseTagIterator
- type TransactorAPI
Constants ¶
This section is empty.
Variables ¶
var ( ORG_ADMIN = crypto.Keccak256Hash([]byte("ORG_ADMIN_ROLE")) REPO_DEV = crypto.Keccak256Hash([]byte("REPO_DEV_ROLE")) ADD_KEY = crypto.Keccak256Hash([]byte("ADD_KEY_OPERATION")) REVOKE_KEY = crypto.Keccak256Hash([]byte("REVOKE_KEY_OPERATION")) ROTATE_KEY = crypto.Keccak256Hash([]byte("ROTATE_KEY_OPERATION")) )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Valist SDK client.
func (*Client) CreateOrganization ¶
func (client *Client) CreateOrganization(ctx context.Context, meta *types.OrganizationMeta) (*valist.ValistOrgCreated, error)
CreateOrganization creates a new organization using the given metadata.
func (*Client) CreateRepository ¶
func (client *Client) CreateRepository(ctx context.Context, orgID common.Hash, name string, meta *types.RepositoryMeta) (*valist.ValistRepoCreated, error)
CreateRepository creates a repository in the organization with the given orgID.
func (*Client) GetLatestRelease ¶
func (client *Client) GetLatestRelease(ctx context.Context, orgID common.Hash, repoName string) (*types.Release, error)
GetLatestRelease returns the most recent release from the repo with the given repoName and orgID.
func (*Client) GetOrganization ¶
func (client *Client) GetOrganization(ctx context.Context, id common.Hash) (*types.Organization, error)
GetOrganization returns the organization with the given orgID.
func (*Client) GetOrganizationID ¶
GetOrganizationID returns the orgID for the given orgName.
func (*Client) GetOrganizationMeta ¶
func (client *Client) GetOrganizationMeta(ctx context.Context, p string) (*types.OrganizationMeta, error)
GetOrganizationMeta returns the organization metadata from the given path.
func (*Client) GetRelease ¶
func (client *Client) GetRelease(ctx context.Context, orgID common.Hash, repoName, tag string) (*types.Release, error)
GetRelease returns the release from the repo with the given repoName, orgID, and tag.
func (*Client) GetReleaseMeta ¶
GetReleaseMeta returns the release meta from the given path.
func (*Client) GetRepository ¶
func (client *Client) GetRepository(ctx context.Context, orgID common.Hash, repoName string) (*types.Repository, error)
GetRepository returns the repository with the given orgID and repoName.
func (*Client) GetRepositoryMeta ¶
func (client *Client) GetRepositoryMeta(ctx context.Context, p string) (*types.RepositoryMeta, error)
GetRepositoryMeta returns the repository meta from the given path.
func (*Client) LinkOrganizationName ¶
func (client *Client) LinkOrganizationName(ctx context.Context, orgID common.Hash, name string) (*registry.ValistRegistryMappingEvent, error)
LinkOrganizationName links the given orgID to the orgName.
func (*Client) ListReleaseTags ¶
ListReleaseTags returns an iterator for retrieving all release tags from the repo with the given repoName and orgID.
func (*Client) ListReleases ¶
ListReleases returns an iterator for retrieving all releases from the repo with the given repoName and orgID.
func (*Client) ResolvePath ¶
ResolvePath resolves the organization, repository, release, and node from the given path.
func (*Client) SetOrganizationMeta ¶
func (client *Client) SetOrganizationMeta(ctx context.Context, orgID common.Hash, meta *types.OrganizationMeta) (*valist.ValistMetaUpdate, error)
SetOrganizationMeta updates the metadata of the organization with the given orgID.
func (*Client) SetRepositoryMeta ¶
func (client *Client) SetRepositoryMeta(ctx context.Context, orgID common.Hash, name string, meta *types.RepositoryMeta) (*valist.ValistMetaUpdate, error)
SetRepositoryMeta updates the metadata of the repository with the given orgID and repoName.
func (*Client) VoteOrganizationAdmin ¶
func (client *Client) VoteOrganizationAdmin(ctx context.Context, orgID common.Hash, operation common.Hash, address common.Address) (*valist.ValistVoteKeyEvent, error)
VoteOrganizationAdmin votes to add, revoke, or rotate an organization admin key.
func (*Client) VoteOrganizationThreshold ¶
func (client *Client) VoteOrganizationThreshold(ctx context.Context, orgID common.Hash, threshold *big.Int) (*valist.ValistVoteThresholdEvent, error)
VoteOrganizationThreshold votes to set a multifactor voting threshold for the organization.
func (*Client) VoteRelease ¶
func (client *Client) VoteRelease(ctx context.Context, orgID common.Hash, repoName string, release *types.Release) (*valist.ValistVoteReleaseEvent, error)
VoteRelease votes to publish a new release to the repo with the given orgID and repoName.
func (*Client) VoteRepoDev ¶
func (client *Client) VoteRepoDev(ctx context.Context, orgID common.Hash, repoName string, operation common.Hash, address common.Address) (*valist.ValistVoteKeyEvent, error)
VoteRepoDev votes to add, revoke, or rotate a repository dev key.
type Options ¶
type Options struct { Ethereum bind.DeployBackend IPFS coreiface.CoreAPI Valist *valist.Valist Registry *registry.ValistRegistry Signer *signer.Signer Transactor TransactorAPI }
Options is used to set client options.
type ReleaseIterator ¶
type ReleaseIterator struct {
// contains filtered or unexported fields
}
ReleaseIterator is used to iterate releases.
type ReleaseTagIterator ¶
type ReleaseTagIterator struct {
// contains filtered or unexported fields
}
ReleaseTagIterator is used to iterate release tags.
type TransactorAPI ¶
type TransactorAPI interface { CreateOrganizationTx(*gasless.TransactOpts, string) (*types.Transaction, error) LinkOrganizationNameTx(*gasless.TransactOpts, common.Hash, string) (*types.Transaction, error) CreateRepositoryTx(*gasless.TransactOpts, common.Hash, string, string) (*types.Transaction, error) VoteKeyTx(*gasless.TransactOpts, common.Hash, string, common.Hash, common.Address) (*types.Transaction, error) VoteReleaseTx(*gasless.TransactOpts, common.Hash, string, string, string, string) (*types.Transaction, error) SetOrganizationMetaTx(*gasless.TransactOpts, common.Hash, string) (*types.Transaction, error) SetRepositoryMetaTx(*gasless.TransactOpts, common.Hash, string, string) (*types.Transaction, error) VoteOrganizationThresholdTx(*gasless.TransactOpts, common.Hash, *big.Int) (*types.Transaction, error) VoteRepositoryThresholdTx(*gasless.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?