keybase

package
v0.0.0-...-66acf6f Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: BSD-3-Clause Imports: 34 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

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

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

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, isIOS bool) (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, isIOS bool)

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 LogToService

func LogToService(str string)

func ReadArr

func ReadArr() (data []byte, err error)

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

func Reset

func Reset() error

Reset resets the socket connection

func SetAppStateBackground

func SetAppStateBackground()

func SetAppStateBackgroundActive

func SetAppStateBackgroundActive()

func SetAppStateForeground

func SetAppStateForeground()

func SetAppStateInactive

func SetAppStateInactive()

func Version

func Version() string

Version returns semantic version string

func WriteArr

func WriteArr(b []byte) (err error)

WriteArr sends raw bytes encoded msgpack rpc payload, ios only

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

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