gobotexample

package module
v0.0.0-...-04e43ac Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2021 License: LGPL-3.0 Imports: 20 Imported by: 0

README

sunrise-social-go-sbot

this repo helps you build go-ssb into an android / iOS (untested) library.

gomobile

The Mobile page on the golang wiki is a good starting intro. Use the SDK instructions but change golang.org/x/mobile/example/basic with this package. Probably want to fork it first and then add all your stuff like passing configs from android and setting up storage locations and what not... If you fork it, replace github.com/cryptix/gobotexample with your own import path!

gomobile modules workaround

there is some weirdness with Go Modules and gomobile, you want to use export GO111MODULE=off for the foresable future to run the gomobile bind ... call.

The current checked in deps should work but here is how to update them:

# switch on module mode to update the `go.mod` file
export GO111MODULE=on

# pull in your wanted version of a dep
go get go.cryptoscope.co/ssb@someNewStuffOrVersion

# copy the dependencies into the `vendor/` folder
go mod vendor

# switch of module module mode for the actual building
export GO111MODULE=off

# compile all the dependencies
# the output should include lines containing github.com/cryptix/gobotexample/vendor/.... (or what ever you changed the impport of this project to)
go build -v -i

# run the (very basic) tests to see the bot starts and stops
go test

# build the cross-compiled bindings
gomobile bind -o app/gosbot.aar -target=android github.com/cryptix/gobotexample

As a sanity check there is a simple start>sleep(1)>stop test (run go test) that you can use before running gomobile .. to see if the code compiles.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotInitialized = errors.New("gobot: not initialized")

Functions

func BlobsAdd

func BlobsAdd(blob []byte) (string, error)

func BlobsGet

func BlobsGet(refStr string) ([]byte, error)

func BlobsHas

func BlobsHas()

func BlobsList

func BlobsList()

func BlobsRemove

func BlobsRemove()

func BlobsWant

func BlobsWant(blobref string)

func CurrentMessageCount

func CurrentMessageCount() (int64, error)

func GossipConnect

func GossipConnect(multiserveraddress string) error

func Peers

func Peers() ([]byte, error)

func Publish

func Publish(message string) error

How much is checked by the stack if a not json string gets passed?

func PullMessages

func PullMessages(last, limit int) ([]byte, error)

func Start

func Start(repoPath string)

func Stop

func Stop() error

func WhoAmI

func WhoAmI() string

Types

type MessageWithRootSeq

type MessageWithRootSeq struct {
	ssb.KeyValueRaw
	RootSeq int64 `json:"seqField"`
}

Directories

Path Synopsis
internal
multiserver
first draft of an (surely) incomlete implemenation of multiserver addresses
first draft of an (surely) incomlete implemenation of multiserver addresses

Jump to

Keyboard shortcuts

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