bots

package
v0.0.0-...-31fc120 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: MIT Imports: 1 Imported by: 3

Documentation

Overview

Package bots contains shared data between the host and plugins.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConfig

type ClientConfig struct {
	Store  DatastoreWithoutQuery
	Ipfs   Ipfs
	Params map[string]string
}

ClientConfig contain all the services and config passed by the host node

type DatastoreWithoutQuery

type DatastoreWithoutQuery interface {
	// See datastore Get
	Get(key datastore.Key) (value []byte, err error)
	// See datastore Has
	Has(key datastore.Key) (exists bool, err error)
	// See datastore GetSize
	GetSize(key datastore.Key) (size int, err error)
	// See datastore Put
	Put(key datastore.Key, value []byte) error
	// See datastore Delete
	Delete(key datastore.Key) error
	// See datastore Close
	Close() error
}

Read is the read-side of the Datastore interface minus Query.

type HostConfig

type HostConfig struct {
	Name           string
	ID             string
	ReleaseVersion int
	ReleaseHash    string
	Params         map[string]string
}

HostConfig is pulled from the bot config file

type Ipfs

type Ipfs interface {
	Get(path string, key string) (data []byte, err error)
	Add(data []byte, encrypt bool) (hash string, key string, err error)
}

Ipfs is an interface to the gateway method to fetch + decrypt content

type Response

type Response struct {
	Status      int32
	Body        []byte
	ContentType string
}

Response is the response for each request to a Bot

type Service

type Service interface {
	Post(data []byte, body []byte, shared ClientConfig) (Response, error)
	Get(data []byte, shared ClientConfig) (Response, error)
	Put(data []byte, body []byte, shared ClientConfig) (Response, error)
	Delete(data []byte, shared ClientConfig) (Response, error)
}

Service defines the methods served by any bot

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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