client

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: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a Valist SDK client.

func NewClient

func NewClient(opts *Options) (*Client, error)

NewClient create a client from the given options.

func (*Client) Close

func (client *Client) Close()

Close releases all client resources.

func (*Client) CreateOrganization

func (client *Client) CreateOrganization(ctx context.Context, meta *types.OrganizationMeta) (*valist.ValistOrgCreated, error)

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 latest release from the repository with the given name 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 ID.

func (*Client) GetOrganizationID

func (client *Client) GetOrganizationID(ctx context.Context, name string) (common.Hash, error)

GetOrganizationID returns the ID of the organization with the given name.

func (*Client) GetOrganizationMeta

func (client *Client) GetOrganizationMeta(ctx context.Context, id cid.Cid) (*types.OrganizationMeta, error)

GetOrganizationMeta returns the organization meta with the given CID.

func (*Client) GetRelease

func (client *Client) GetRelease(ctx context.Context, orgID common.Hash, repoName, tag string) (*types.Release, error)

GetRelease returns the release with the given tag in the repository with the given name and orgID.

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 name.

func (*Client) GetRepositoryMeta

func (client *Client) GetRepositoryMeta(ctx context.Context, id cid.Cid) (*types.RepositoryMeta, error)

GetRepositoryMeta returns the repository meta with the given CID.

func (*Client) LinkOrganizationName

func (client *Client) LinkOrganizationName(ctx context.Context, orgID common.Hash, name string) (*registry.ValistRegistryMappingEvent, error)

LinkOrganizationName creates a link from the given orgID to the given name.

func (*Client) ListReleaseTags

func (client *Client) ListReleaseTags(orgID common.Hash, repoName string, page, limit *big.Int) types.ReleaseTagIterator

ListReleaseTags returns a new ReleaseTagIterator.

func (*Client) ListReleases

func (client *Client) ListReleases(orgID common.Hash, repoName string, page, limit *big.Int) types.ReleaseIterator

ListReleases returns a new ReleaseIterator.

func (*Client) ReadFile

func (client *Client) ReadFile(ctx context.Context, id cid.Cid) ([]byte, error)

func (*Client) SetRepositoryMeta

func (client *Client) SetRepositoryMeta(ctx context.Context, orgID common.Hash, name string, meta *types.RepositoryMeta) (*valist.ValistMetaUpdate, error)

func (*Client) VoteOrganizationThreshold

func (client *Client) VoteOrganizationThreshold(ctx context.Context, orgID common.Hash, threshold *big.Int) (*valist.ValistVoteThresholdEvent, error)

func (*Client) VoteRelease

func (client *Client) VoteRelease(ctx context.Context, orgID common.Hash, repoName string, release *types.Release) (*valist.ValistVoteReleaseEvent, error)

VoteRelease votes on a release in the given organization's repository with the given release and meta CIDs.

func (*Client) VoteRepositoryThreshold

func (client *Client) VoteRepositoryThreshold(ctx context.Context, orgID common.Hash, name string, threshold *big.Int) (*valist.ValistVoteThresholdEvent, error)

func (*Client) WriteDirEntries

func (client *Client) WriteDirEntries(ctx context.Context, base string, fpaths []string) (cid.Cid, error)

func (*Client) WriteFile

func (client *Client) WriteFile(ctx context.Context, data []byte) (cid.Cid, error)

func (*Client) WriteFilePath

func (client *Client) WriteFilePath(ctx context.Context, fpath string) (cid.Cid, error)

type Close

type Close func() error

Close is a callback invoked when the client is closed.

type Options

type Options struct {
	IPFS     coreiface.CoreAPI
	Ethereum bind.DeployBackend
	ChainID  *big.Int

	Valist   *valist.Valist
	Registry *registry.ValistRegistry

	Account accounts.Account
	Wallet  accounts.Wallet

	TransactOpts TransactOpts
	Transactor   types.TransactorAPI

	OnClose []Close
}

Options is used to set client options.

type ReleaseIterator

type ReleaseIterator struct {
	// contains filtered or unexported fields
}

ReleaseIterator is used to iterate releases.

func (*ReleaseIterator) ForEach

func (it *ReleaseIterator) ForEach(ctx context.Context, cb func(*types.Release)) error

ForEach calls the given callback for each release.

func (*ReleaseIterator) Next

func (it *ReleaseIterator) Next(ctx context.Context) (*types.Release, error)

Next returns the next release from the iterator. Returns EOF when no releases are left.

type ReleaseTagIterator

type ReleaseTagIterator struct {
	// contains filtered or unexported fields
}

ReleaseTagIterator is used to iterate release tags.

func (*ReleaseTagIterator) Next

func (it *ReleaseTagIterator) Next(ctx context.Context) (string, error)

Next returns the next tag in the iterator.

type TransactOpts

type TransactOpts func(account accounts.Account, wallet accounts.Wallet, chainID *big.Int) *bind.TransactOpts

TransactOpts is a function that returns transaction options for an Ethereum transaction.

Directories

Path Synopsis
Package metatx defines a Transactor that uses meta transactions to pay gas fees on behalf of a user.
Package metatx defines a Transactor that uses meta transactions to pay gas fees on behalf of a user.

Jump to

Keyboard shortcuts

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