Documentation
¶
Overview ¶
Package mobile provides an entry point for gomobile to start the ondict HTTP server on Android.
Index ¶
- func Complete(prefix string, limit int) string
- func ConfigureSync(baseURL, username, password string) error
- func GetCSS() string
- func GetFile(name string) []byte
- func Init(configDir, cacheDir string) error
- func InitSyncOnly(configDir, cacheDir, baseURL, username, password string) error
- func IsSyncTransient(errMsg string) bool
- func QueryEntry(word string) string
- func StartServer(configDir, cacheDir string, port int)
- func Sync() (string, error)
- func WordbankAdd(word string) string
- func WordbankContains(word string) bool
- func WordbankList() string
- func WordbankRemove(word string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Complete ¶ added in v0.7.0
Complete returns a JSON array of up to limit completion suggestions for the given prefix, using fuzzy matching. Calls sources.Complete directly without going through the HTTP server.
gomobile-friendly: only primitive types in the signature.
func ConfigureSync ¶ added in v0.7.0
ConfigureSync wires up the sync client. Call this once after StartServer (it depends on util.SetPaths having already been called). Empty baseURL, username, or password disables sync (returns no error).
The same *sql.DB instances are shared with the wordbank/history package shims via SetStore so the WebView's writes and the sync client's reads both go through one connection pool — opening separate handles to the same SQLite file is a recipe for write-lock contention and stale reads.
gomobile-friendly: only primitive types in the signature.