Documentation ¶
Index ¶
- Constants
- func Bool(v bool) (p *bool)
- func GetToken(path, method string) (string, error)
- func IsHTTPStatusErrorCode(err error, code int) bool
- type AuthResponse
- type AuthService
- type BytesService
- type BytesUploadResponse
- type ChunksService
- type ChunksUploadResponse
- type Client
- type ClientOptions
- type DirsService
- type DirsUploadResponse
- type FilesService
- type FilesUploadResponse
- type HTTPStatusError
- type PSSService
- type PinningService
- func (ps *PinningService) GetPinnedRootHash(ctx context.Context, ref swarm.Address) (swarm.Address, error)
- func (ps *PinningService) GetPins(ctx context.Context) ([]swarm.Address, error)
- func (ps *PinningService) PinRootHash(ctx context.Context, ref swarm.Address) error
- func (ps *PinningService) UnpinRootHash(ctx context.Context, ref swarm.Address) error
- type SOCService
- type SocResponse
- type StewardshipService
- type TagResponse
- type TagsService
- type UploadOptions
Constants ¶
const ( TokenConsumer = "CP5tR8Zqd2txobVbWn02+YXZ6YEXDBjl8lq1cYaRHDJLE7rldjGBft5r2imUTAnExkQoSoBWSywCG93feYF5jtDN3kHpxcwKrm0Mz/JJknYZFzcZml8=" TokenCreator = "v2ACGxBiGJf3Jyos7MX/vq8nrp8zTVx/mT3wtGPXA/ayNBQdIZLIgd/gNlWoaS5r6AQ22zUAYa4hcbx93bKyUmIaKSJBuOGz/Sz0/dnUAZjkocF0pg==" TokenMaintainer = "MZhpzQUMPyNMmbrQMKcTBLzHpLpz3JB1CKuFVuHH+yqzZI6kzdjWI4OOhGw1l5NonvwZMhxTOlCmsmW2Fq/dRLgvn8EiKyOKNDsYcK8es94IwkMwKLcebw==" TokenAccountant = "3jpNFZwiVDAFeMEDi5tvSZ8czxgZjZr6AWaRSB0ApVueucGXpLbMVvU38HPxJtTIjEtW6BUtFb8EEkKfsw12coM+JngWNaRm9bWwJsCoG8b69oCklGK2sw==" )
Variables ¶
This section is empty.
Functions ¶
func Bool ¶
Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.
func IsHTTPStatusErrorCode ¶ added in v0.8.5
IsHTTPStatusErrorCode return whether the error is HTTPStatusError with a specific HTTP status code.
Types ¶
type AuthResponse ¶ added in v0.8.6
type AuthResponse struct {
Key string `json:"key"`
}
AuthResponse represents authentication response
type AuthService ¶ added in v0.8.6
type AuthService service
AuthService represents Bee's Auth service
func (*AuthService) Authenticate ¶ added in v0.8.6
Authenticate gets the bearer security token based on given credentials
type BytesService ¶ added in v0.8.5
type BytesService service
BytesService represents Bee's Bytes service
func (*BytesService) Download ¶ added in v0.8.5
func (b *BytesService) Download(ctx context.Context, a swarm.Address) (resp io.ReadCloser, err error)
Download downloads data from the node
func (*BytesService) Upload ¶ added in v0.8.5
func (b *BytesService) Upload(ctx context.Context, data io.Reader, o UploadOptions) (BytesUploadResponse, error)
Upload uploads bytes to the node
type BytesUploadResponse ¶ added in v0.8.5
BytesUploadResponse represents Upload's response
type ChunksService ¶ added in v0.8.5
type ChunksService service
ChunksService represents Bee's Chunks service
func (*ChunksService) Download ¶ added in v0.8.5
func (c *ChunksService) Download(ctx context.Context, a swarm.Address, targets string) (resp io.ReadCloser, err error)
Download downloads data from the node
func (*ChunksService) Upload ¶ added in v0.8.5
func (c *ChunksService) Upload(ctx context.Context, data []byte, o UploadOptions) (ChunksUploadResponse, error)
Upload uploads chunks to the node
type ChunksUploadResponse ¶ added in v0.8.5
ChunksUploadResponse represents Upload's response
type Client ¶
type Client struct { // Services that API provides. Bytes *BytesService Chunks *ChunksService Files *FilesService Dirs *DirsService Pinning *PinningService Tags *TagsService PSS *PSSService SOC *SOCService Stewardship *StewardshipService Auth *AuthService // contains filtered or unexported fields }
Client manages communication with the Bee API.
type ClientOptions ¶
ClientOptions holds optional parameters for the Client.
type DirsService ¶ added in v0.8.5
type DirsService service
DirsService represents Bee's Dirs service
func (*DirsService) Download ¶ added in v0.8.5
func (s *DirsService) Download(ctx context.Context, a swarm.Address, path string) (resp io.ReadCloser, err error)
Download downloads data from the node
func (*DirsService) Upload ¶ added in v0.8.5
func (s *DirsService) Upload(ctx context.Context, data io.Reader, size int64, o UploadOptions) (resp DirsUploadResponse, err error)
Upload uploads TAR collection to the node
type DirsUploadResponse ¶ added in v0.8.5
DirsUploadResponse represents Upload's response
type FilesService ¶ added in v0.8.5
type FilesService service
FilesService represents Bee's Files service
func (*FilesService) Download ¶ added in v0.8.5
func (f *FilesService) Download(ctx context.Context, a swarm.Address) (resp io.ReadCloser, err error)
Download downloads data from the node
func (*FilesService) Upload ¶ added in v0.8.5
func (f *FilesService) Upload(ctx context.Context, name string, data io.Reader, size int64, o UploadOptions) (resp FilesUploadResponse, err error)
Upload uploads files to the node
type FilesUploadResponse ¶ added in v0.8.5
FilesUploadResponse represents Upload's response
type HTTPStatusError ¶ added in v0.8.5
type HTTPStatusError struct {
Code int
}
HTTPStatusError represents the error derived from the HTTP response status code.
func NewHTTPStatusError ¶ added in v0.8.5
func NewHTTPStatusError(code int) *HTTPStatusError
NewHTTPStatusError creates a new instance of HTTPStatusError based on the provided code.
func (*HTTPStatusError) Error ¶ added in v0.8.5
func (e *HTTPStatusError) Error() string
type PinningService ¶ added in v0.8.5
type PinningService service
PinningService represents Bee's Pin service
func (*PinningService) GetPinnedRootHash ¶ added in v0.8.5
func (ps *PinningService) GetPinnedRootHash(ctx context.Context, ref swarm.Address) (swarm.Address, error)
GetPinnedRootHash determines if the root hash of given reference is pinned by returning its reference.
func (*PinningService) GetPins ¶ added in v0.8.5
GetPins returns all references of pinned root hashes.
func (*PinningService) PinRootHash ¶ added in v0.8.5
PinRootHash pins root hash of given reference.
func (*PinningService) UnpinRootHash ¶ added in v0.8.5
UnpinRootHash unpins root hash of given reference.
type SocResponse ¶ added in v0.8.5
type StewardshipService ¶ added in v0.8.5
type StewardshipService service
StewardshipService represents Bee's Stewardship service.
func (*StewardshipService) IsRetrievable ¶ added in v0.8.5
IsRetrievable checks whether the content on the given address is retrievable.
type TagResponse ¶ added in v0.8.5
type TagResponse struct { Total int64 `json:"total"` Split int64 `json:"split"` Seen int64 `json:"seen"` Stored int64 `json:"stored"` Sent int64 `json:"sent"` Synced int64 `json:"synced"` Uid uint32 `json:"uid"` Name string `json:"name"` Address swarm.Address `json:"address"` StartedAt time.Time `json:"startedAt"` }
type TagsService ¶ added in v0.8.5
type TagsService service
TagsService represents Bee's Tag service
func (*TagsService) CreateTag ¶ added in v0.8.5
func (p *TagsService) CreateTag(ctx context.Context) (resp TagResponse, err error)
CreateTag creates new tag
func (*TagsService) GetTag ¶ added in v0.8.5
func (p *TagsService) GetTag(ctx context.Context, tagUID uint32) (resp TagResponse, err error)
GetTag gets a new tag