Documentation ¶
Index ¶
- Constants
- type Greenfield
- func (greenfield *Greenfield) Close() error
- func (greenfield *Greenfield) GetCurrentHeight(ctx context.Context) (uint64, error)
- func (greenfield *Greenfield) HasAccount(ctx context.Context, address string) (bool, error)
- func (greenfield *Greenfield) ListenObjectSeal(ctx context.Context, bucket, object string, timeOutHeight int) (err error)
- func (greenfield *Greenfield) QueryBucketInfo(ctx context.Context, bucket string) (*storagetypes.BucketInfo, error)
- func (greenfield *Greenfield) QueryBucketInfoAndObjectInfo(ctx context.Context, bucket, object string) (*storagetypes.BucketInfo, *storagetypes.ObjectInfo, error)
- func (greenfield *Greenfield) QueryObjectInfo(ctx context.Context, bucket, object string) (*storagetypes.ObjectInfo, error)
- func (greenfield *Greenfield) QueryObjectInfoByID(ctx context.Context, objectID string) (*storagetypes.ObjectInfo, error)
- func (greenfield *Greenfield) QuerySPInfo(ctx context.Context) ([]*sptypes.StorageProvider, error)
- func (greenfield *Greenfield) QueryStorageParams(ctx context.Context) (params *storagetypes.Params, err error)
- func (greenfield *Greenfield) QueryStreamRecord(ctx context.Context, account string) (*paymenttypes.StreamRecord, error)
- func (greenfield *Greenfield) VerifyGetObjectPermission(ctx context.Context, account, bucket, object string) (bool, error)
- func (greenfield *Greenfield) VerifyPutObjectPermission(ctx context.Context, account, bucket, object string) (bool, error)
- type GreenfieldChainConfig
- type GreenfieldClient
- type NodeConfig
Constants ¶
const ( // UpdateClientInternal defines the period of updating the best chain client UpdateClientInternal = 60 // ExpectedOutputBlockInternal defines the time of estimating output block time ExpectedOutputBlockInternal = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Greenfield ¶
type Greenfield struct {
// contains filtered or unexported fields
}
Greenfield is an encapsulation of greenfield chain go sdk which supports for more query request
func NewGreenfield ¶
func NewGreenfield(cfg *GreenfieldChainConfig) (*Greenfield, error)
NewGreenfield return the Greenfield instance.
func (*Greenfield) Close ¶
func (greenfield *Greenfield) Close() error
Close the Greenfield instance.
func (*Greenfield) GetCurrentHeight ¶
func (greenfield *Greenfield) GetCurrentHeight(ctx context.Context) (uint64, error)
GetCurrentHeight the block height sub one as the stable height.
func (*Greenfield) HasAccount ¶
HasAccount returns an indication of the existence of address.
func (*Greenfield) ListenObjectSeal ¶
func (greenfield *Greenfield) ListenObjectSeal(ctx context.Context, bucket, object string, timeOutHeight int) (err error)
ListenObjectSeal return an indication of the object is sealed. TODO:: retrieve service support seal event subscription
func (*Greenfield) QueryBucketInfo ¶
func (greenfield *Greenfield) QueryBucketInfo(ctx context.Context, bucket string) (*storagetypes.BucketInfo, error)
QueryBucketInfo return the bucket info by name.
func (*Greenfield) QueryBucketInfoAndObjectInfo ¶
func (greenfield *Greenfield) QueryBucketInfoAndObjectInfo(ctx context.Context, bucket, object string) (*storagetypes.BucketInfo, *storagetypes.ObjectInfo, error)
QueryBucketInfoAndObjectInfo return bucket info and object info, if not found, return the corresponding error code
func (*Greenfield) QueryObjectInfo ¶
func (greenfield *Greenfield) QueryObjectInfo(ctx context.Context, bucket, object string) (*storagetypes.ObjectInfo, error)
QueryObjectInfo return the object info by name.
func (*Greenfield) QueryObjectInfoByID ¶ added in v0.1.1
func (greenfield *Greenfield) QueryObjectInfoByID(ctx context.Context, objectID string) (*storagetypes.ObjectInfo, error)
QueryObjectInfoByID return the object info by name.
func (*Greenfield) QuerySPInfo ¶
func (greenfield *Greenfield) QuerySPInfo(ctx context.Context) ([]*sptypes.StorageProvider, error)
QuerySPInfo returns the list of storage provider info.
func (*Greenfield) QueryStorageParams ¶
func (greenfield *Greenfield) QueryStorageParams(ctx context.Context) (params *storagetypes.Params, err error)
QueryStorageParams returns storage params
func (*Greenfield) QueryStreamRecord ¶
func (greenfield *Greenfield) QueryStreamRecord(ctx context.Context, account string) (*paymenttypes.StreamRecord, error)
QueryStreamRecord return the steam record info by account.
func (*Greenfield) VerifyGetObjectPermission ¶
func (greenfield *Greenfield) VerifyGetObjectPermission(ctx context.Context, account, bucket, object string) (bool, error)
VerifyGetObjectPermission verify get object permission.
func (*Greenfield) VerifyPutObjectPermission ¶
func (greenfield *Greenfield) VerifyPutObjectPermission(ctx context.Context, account, bucket, object string) (bool, error)
VerifyPutObjectPermission verify put object permission.
type GreenfieldChainConfig ¶
type GreenfieldChainConfig struct { ChainID string NodeAddr []*NodeConfig }
type GreenfieldClient ¶
type GreenfieldClient struct { Provider []string // contains filtered or unexported fields }
GreenfieldClient the greenfield chain client, only use to query.
func (*GreenfieldClient) GnfdCompositeClient ¶
func (client *GreenfieldClient) GnfdCompositeClient() *chain.GnfdCompositeClient
GnfdCompositeClient return the greenfield chain client