keybase

package
v5.4.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2020 License: BSD-3-Clause, BSD-3-Clause Imports: 35 Imported by: 0

README

Bind

Go bindable package that includes both Keybase client and KBFS for gomobile builds.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppBeginBackgroundTask

func AppBeginBackgroundTask(pusher PushNotifier)

AppBeginBackgroundTask notifies us that an app background task has been started on our behalf. This function will return once we no longer need any time in the background.

func AppBeginBackgroundTaskNonblock

func AppBeginBackgroundTaskNonblock(pusher PushNotifier)

func AppDidEnterBackground added in v1.0.48

func AppDidEnterBackground() bool

AppDidEnterBackground notifies the service that the app is in the background [iOS] returning true will request about ~3mins from iOS to continue execution

func AppWillExit added in v1.0.48

func AppWillExit(pusher PushNotifier)

AppWillExit is called reliably on iOS when the app is about to terminate not as reliably on android

func BackgroundSync

func BackgroundSync()

func ForceGC added in v1.0.41

func ForceGC()

ForceGC Forces a gc

func HandleBackgroundNotification

func HandleBackgroundNotification(strConvID, body, serverMessageBody, sender string, intMembersType int,
	displayPlaintext bool, intMessageID int, pushID string, badgeCount, unixTime int, soundName string,
	pusher PushNotifier, showIfStale bool) (err error)

func HandlePostTextReply

func HandlePostTextReply(strConvID, tlfName string, intMessageID int, body string) (err error)

func Init

func Init(homeDir, mobileSharedHome, logFile, runModeStr string,
	accessGroupOverride bool, externalDNSNSFetcher ExternalDNSNSFetcher, nvh NativeVideoHelper,
	mobileOsVersion string, isIPad bool, installReferrerListener NativeInstallReferrerListener) (err error)

Init runs the Keybase services

func InitOnce

func InitOnce(homeDir, mobileSharedHome, logFile, runModeStr string,
	accessGroupOverride bool, dnsNSFetcher ExternalDNSNSFetcher, nvh NativeVideoHelper,
	mobileOsVersion string, isIPad bool, installReferrerListener NativeInstallReferrerListener)

InitOnce runs the Keybase services (only runs one time)

func IsAppStateForeground

func IsAppStateForeground() bool

func LogSend

func LogSend(statusJSON string, feedback string, sendLogs, sendMaxBytes bool, traceDir, cpuProfileDir string) (res string, err error)

LogSend sends a log to Keybase

func ReadB64

func ReadB64() (res string, err error)

ReadB64 is a blocking read for base64 encoded msgpack rpc data. It is called serially by the mobile run loops.

func Reset

func Reset() error

Reset resets the socket connection

func SetAppStateBackground added in v1.0.48

func SetAppStateBackground()

func SetAppStateBackgroundActive added in v1.0.48

func SetAppStateBackgroundActive()

func SetAppStateForeground added in v1.0.48

func SetAppStateForeground()

func SetAppStateInactive added in v1.0.48

func SetAppStateInactive()

func Version added in v1.0.18

func Version() string

Version returns semantic version string

func WriteB64

func WriteB64(str string) (err error)

WriteB64 sends a base64 encoded msgpack rpc payload

Types

type ChatNotification

type ChatNotification struct {
	Message   *Message
	ConvID    string
	TeamName  string
	TopicName string
	TlfName   string
	// e.g. "keybase#general, CoolTeam, Susannah,Jake"
	ConversationName    string
	IsGroupConversation bool
	IsPlaintext         bool
	SoundName           string
	BadgeCount          int
}

type ExternalDNSNSFetcher added in v1.0.21

type ExternalDNSNSFetcher interface {
	GetServers() []byte
}

type InstallReferrerListener

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

InstallReferrerListener is a wrapper around NativeInstallReferrerListener to work around gomobile/gobind limitations while preventing import cycles.

func (InstallReferrerListener) StartInstallReferrerListener

func (i InstallReferrerListener) StartInstallReferrerListener(callback service.StringReceiver)

type Message

type Message struct {
	ID            int
	Kind          string // "Text" | "Reaction"
	Plaintext     string
	ServerMessage string // This is the server's suggested display message for the notification
	From          *Person
	At            int64
}

type NativeInstallReferrerListener

type NativeInstallReferrerListener interface {
	// StartInstallReferrerListener is used to get referrer information from the
	// google play store on Android (to implement deferred deep links). This is
	// asynchronous (due to the underlying play store api being so): pass it a
	// callback function which will be called with the referrer string once it
	// is available (or an empty string in case of errors).
	StartInstallReferrerListener(callback StringReceiver)
}

NativeInstallReferrerListener is implemented in Java on Android.

type NativeVideoHelper

type NativeVideoHelper interface {
	Thumbnail(filename string) []byte
	Duration(filename string) int
}

type Person

type Person struct {
	KeybaseUsername string
	KeybaseAvatar   string
	IsBot           bool
}

type PushNotifier

type PushNotifier interface {
	LocalNotification(ident string, msg string, badgeCount int, soundName string, convID string, typ string)
	DisplayChatNotification(notification *ChatNotification)
}

type StringReceiver

type StringReceiver interface {
	CallbackWithString(s string)
}

Jump to

Keyboard shortcuts

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