textilebots

package module
v0.0.0-...-575b11f Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2019 License: MIT Imports: 10 Imported by: 2

README

go-textile-bots

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	BotID      string
	Name       string
	Service    shared.Service
	SharedConf shared.ClientConfig
	// contains filtered or unexported fields
}

func (*Client) Prepare

func (b *Client) Prepare(botID string, version int, name string, pth string, config shared.ClientConfig)

setup will configure the rpc server information for the bot

func (*Client) Run

func (b *Client) Run()

type GRPCBotStoreClient

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

func (*GRPCBotStoreClient) Close

func (m *GRPCBotStoreClient) Close() error

func (*GRPCBotStoreClient) Delete

func (m *GRPCBotStoreClient) Delete(key datastore.Key) error

func (*GRPCBotStoreClient) Get

func (m *GRPCBotStoreClient) Get(key datastore.Key) ([]byte, error)

BotStore Client

func (*GRPCBotStoreClient) GetSize

func (m *GRPCBotStoreClient) GetSize(key datastore.Key) (int, error)

func (*GRPCBotStoreClient) Has

func (m *GRPCBotStoreClient) Has(key datastore.Key) (bool, error)

func (*GRPCBotStoreClient) Put

func (m *GRPCBotStoreClient) Put(key datastore.Key, value []byte) error

type GRPCBotStoreServer

type GRPCBotStoreServer struct {
	// This is the real implementation
	Impl shared.DatastoreWithoutQuery
}

Here is the gRPC server that GRPCClient talks to.

func (*GRPCBotStoreServer) Close

func (m *GRPCBotStoreServer) Close(ctx context.Context, req *proto.Empty) (resp *proto.Empty, err error)

func (*GRPCBotStoreServer) Delete

func (m *GRPCBotStoreServer) Delete(ctx context.Context, req *proto.DatastoreKey) (resp *proto.Empty, err error)

func (*GRPCBotStoreServer) Get

BotStore Server

func (*GRPCBotStoreServer) GetSize

func (m *GRPCBotStoreServer) GetSize(ctx context.Context, req *proto.DatastoreKey) (resp *proto.DatastoreSize, err error)

func (*GRPCBotStoreServer) Has

func (m *GRPCBotStoreServer) Has(ctx context.Context, req *proto.DatastoreKey) (resp *proto.Exists, err error)

func (*GRPCBotStoreServer) Put

func (m *GRPCBotStoreServer) Put(ctx context.Context, req *proto.DatastoreKeyValue) (resp *proto.Empty, err error)

type GRPCClient

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

GRPCClient is an implementation of KV that talks over RPC.

func (*GRPCClient) Delete

func (m *GRPCClient) Delete(q []byte, config shared.ClientConfig) (shared.Response, error)

func (*GRPCClient) Get

func (m *GRPCClient) Get(q []byte, config shared.ClientConfig) (shared.Response, error)

func (*GRPCClient) Post

func (m *GRPCClient) Post(q []byte, b []byte, config shared.ClientConfig) (shared.Response, error)

func (*GRPCClient) Put

func (m *GRPCClient) Put(q []byte, b []byte, config shared.ClientConfig) (shared.Response, error)

type GRPCIpfsHandlerClient

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

func (*GRPCIpfsHandlerClient) Add

func (m *GRPCIpfsHandlerClient) Add(data []byte, encrypt bool) (string, string, error)

func (*GRPCIpfsHandlerClient) Get

func (m *GRPCIpfsHandlerClient) Get(path string, key string) ([]byte, error)

IpfsHandler Client

type GRPCIpfsHandlerServer

type GRPCIpfsHandlerServer struct {
	// This is the real implementation
	Impl shared.Ipfs
}

func (*GRPCIpfsHandlerServer) Add

func (m *GRPCIpfsHandlerServer) Add(ctx context.Context, req *proto.AddData) (resp *proto.IPFSPin, err error)

func (*GRPCIpfsHandlerServer) Get

func (m *GRPCIpfsHandlerServer) Get(ctx context.Context, req *proto.GetData) (resp *proto.ByteData, err error)

IpfsHandler Server

type GRPCServer

type GRPCServer struct {
	// This is the real implementation
	Impl shared.Service
	// contains filtered or unexported fields
}

Here is the gRPC server that GRPCClient talks to.

func (*GRPCServer) Delete

func (m *GRPCServer) Delete(ctx context.Context, req *proto.APIRequest) (*proto.BotResponse, error)

func (*GRPCServer) Get

func (*GRPCServer) Post

func (*GRPCServer) Put

type TextileBot

type TextileBot struct {
	plugin.NetRPCUnsupportedPlugin
	// Concrete implementation, written in Go. This is only used for plugins
	// that are written in Go.
	Impl shared.Service
}

This is the implementation of plugin.Plugin so we can serve/consume this. We also implement GRPCPlugin so that this plugin can be served over gRPC.

func (*TextileBot) GRPCClient

func (p *TextileBot) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

func (*TextileBot) GRPCServer

func (p *TextileBot) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

Jump to

Keyboard shortcuts

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