textile

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: MIT Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IpfsAddr string
View Source
var MongoHost string
View Source
var MongoPw string
View Source
var MongoUsr string

Functions

func NewClient

func NewClient(store db.Store) *textileClient

Creates a new Textile Client

func NotFound

func NotFound(slug string) error

Types

type Buckd added in v0.0.6

type Buckd interface {
	Stop() error
	Start(ctx context.Context) error
}

type Bucket

type Bucket interface {
	Slug() string
	Key() string
	GetData() BucketData
	GetContext(ctx context.Context) (context.Context, *thread.ID, error)
	DirExists(ctx context.Context, path string) (bool, error)
	FileExists(ctx context.Context, path string) (bool, error)
	UploadFile(
		ctx context.Context,
		path string,
		reader io.Reader,
	) (result path.Resolved, root path.Path, err error)
	GetFile(
		ctx context.Context,
		path string,
		w io.Writer,
	) error
	CreateDirectory(
		ctx context.Context,
		path string,
	) (result path.Resolved, root path.Path, err error)
	ListDirectory(
		ctx context.Context,
		path string,
	) (*DirEntries, error)
	DeleteDirOrFile(
		ctx context.Context,
		path string,
	) (path.Resolved, error)
}

type BucketData

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

type BucketRoot

type BucketRoot buckets_pb.Root

type BucketsClient

type BucketsClient interface {
	PushPath(ctx context.Context, key, pth string, reader io.Reader, opts ...bucketsClient.Option) (result path.Resolved, root path.Resolved, err error)
	PullPath(ctx context.Context, key, pth string, writer io.Writer, opts ...bucketsClient.Option) error
	ListPath(ctx context.Context, key, pth string) (*bucketsproto.ListPathReply, error)
	RemovePath(ctx context.Context, key, pth string, opts ...bucketsClient.Option) (path.Resolved, error)
}

type Client

type Client interface {
	IsRunning() bool
	GetDefaultBucket(ctx context.Context) (Bucket, error)
	GetBucket(ctx context.Context, slug string) (Bucket, error)
	GetBaseThreadsContext(ctx context.Context) (context.Context, error)
	GetBucketContext(ctx context.Context, bucketSlug string) (context.Context, *thread.ID, error)
	GetLocalBucketContext(ctx context.Context, bucketSlug string) (context.Context, *thread.ID, error)
	GetThreadsConnection() (*threadsClient.Client, error)
	ListBuckets(ctx context.Context) ([]Bucket, error)
	CreateBucket(ctx context.Context, bucketSlug string) (Bucket, error)
	Shutdown() error
	WaitForReady() chan bool
	StartAndBootstrap(ctx context.Context, cfg config.Config) error
}

type DirEntries

type DirEntries buckets_pb.ListPathReply

type EventHandler

type EventHandler interface {
	OnCreate(bucketData *BucketData, listenEvent *tc.ListenEvent)
	OnRemove(bucketData *BucketData, listenEvent *tc.ListenEvent)
	OnSave(bucketData *BucketData, listenEvent *tc.ListenEvent)
}

EventHandler

type TextileBuckd added in v0.0.6

type TextileBuckd struct {
	IsRunning bool
	// contains filtered or unexported fields
}

func NewBuckd added in v0.0.6

func NewBuckd(cfg config.Config) *TextileBuckd

func (*TextileBuckd) Shutdown added in v0.0.6

func (tb *TextileBuckd) Shutdown() error

func (*TextileBuckd) Start added in v0.0.6

func (tb *TextileBuckd) Start(ctx context.Context) error

func (*TextileBuckd) Stop added in v0.0.6

func (tb *TextileBuckd) Stop() error

type TextileThreadsd

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

func (*TextileThreadsd) Start

func (tt *TextileThreadsd) Start() error

func (*TextileThreadsd) Stop

func (tt *TextileThreadsd) Stop() error

func (*TextileThreadsd) WaitForReady

func (tt *TextileThreadsd) WaitForReady() chan bool

type ThreadListener

type ThreadListener interface {
	Listen(ctx context.Context) error
	Close()
	RegisterHandler(handler EventHandler)
}

func NewListener

func NewListener(textileClient Client, bucketSlug string, handlers []EventHandler) ThreadListener

type Threadsd

type Threadsd interface {
	WaitForReady() chan bool
	Stop() error
	Start() error
}

func NewThreadsd

func NewThreadsd() Threadsd

Jump to

Keyboard shortcuts

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