buckets

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const CollectionName = "buckets"

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	Key       string `json:"_id"`
	Name      string `json:"name"`
	Path      string `json:"path"`
	DNSRecord string `json:"dns_record,omitempty"`
	CreatedAt int64  `json:"created_at"`
	UpdatedAt int64  `json:"updated_at"`
}

type Buckets

type Buckets struct {
	Threads *dbc.Client
}

func (*Buckets) Create

func (b *Buckets) Create(ctx context.Context, dbID thread.ID, key, name string, pth path.Path, opts ...Option) (*Bucket, error)

func (*Buckets) Delete

func (b *Buckets) Delete(ctx context.Context, dbID thread.ID, key string, opts ...Option) error

func (*Buckets) Get

func (b *Buckets) Get(ctx context.Context, dbID thread.ID, key string, opts ...Option) (*Bucket, error)

func (*Buckets) List

func (b *Buckets) List(ctx context.Context, dbID thread.ID, opts ...Option) ([]*Bucket, error)

func (*Buckets) Save

func (b *Buckets) Save(ctx context.Context, dbID thread.ID, bucket *Bucket, opts ...Option) error

type Option

type Option func(*Options)

func WithToken

func WithToken(t thread.Token) Option

type Options

type Options struct {
	Token thread.Token
}

type Service

type Service struct {
	Collections *c.Collections
	Buckets     *Buckets

	IPFSClient     iface.CoreAPI
	FilecoinClient *fc.Client

	GatewayUrl string

	DNSManager  *dns.Manager
	IPNSManager *ipns.Manager
}

Service is a gRPC service for buckets.

func (*Service) Init

func (s *Service) Init(ctx context.Context, req *pb.InitRequest) (*pb.InitReply, error)
func (s *Service) Links(ctx context.Context, req *pb.LinksRequest) (*pb.LinksReply, error)

func (*Service) List

func (s *Service) List(ctx context.Context, _ *pb.ListRequest) (*pb.ListReply, error)

func (*Service) ListPath

func (s *Service) ListPath(ctx context.Context, req *pb.ListPathRequest) (*pb.ListPathReply, error)

func (*Service) PullPath

func (s *Service) PullPath(req *pb.PullPathRequest, server pb.API_PullPathServer) error

func (*Service) PushPath

func (s *Service) PushPath(server pb.API_PushPathServer) error

func (*Service) Remove

func (s *Service) Remove(ctx context.Context, req *pb.RemoveRequest) (*pb.RemoveReply, error)

func (*Service) RemovePath

func (s *Service) RemovePath(ctx context.Context, req *pb.RemovePathRequest) (*pb.RemovePathReply, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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