gmoryx

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2019 License: MIT Imports: 4 Imported by: 0

README

GMORYX

The GMORYX(GOMOBILE ORYX) is a API adapter to use go-oryx-lib in Android or iOS.

  • AndroidHTTPServer, The HTTP server example for Android.

GOMOBILE

To setup the gomobile, please read blog post.

The Go mobile subrepository adds support for mobile platforms (Android and iOS) and provides tools to build mobile applications.

There are two strategies you can follow to include Go into your mobile stack:

  • Writing all-Go native mobile applications.
  • Writing SDK applications by generating bindings from a Go package and invoke them from Java (on Android) and Objective-C (on iOS).

For more information, please read wiki and repository.

AndroidHTTPServer

First of all, please build the library gmoryx.aar by:

cd $GOPATH/src/github.com/ossrs/go-oryx-lib/gmoryx &&
mkdir -p AndroidHTTPServer/app/libs &&
gomobile bind -target=android -o AndroidHTTPServer/app/libs/gmoryx.aar

Remark: Read GOMOBILE to setup environment.

Open this project in AndroidStudio, run in Android phone, which will start a web server:

GMOryx on Android

Access the web server:

Firefox Client

Winlin, 2017

Documentation

Overview

The gmoryx(gomobile oryx APIs) http package exported for mobile.

The gmoryx(gomobile oryx APIs) http package exported for mobile.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HttpHandle

func HttpHandle(pattern string, handler HttpHandler)

func HttpListenAndServe

func HttpListenAndServe(addr string, handler HttpHandler) (err error)

func HttpShutdown

func HttpShutdown() (err error)

func SetHeader

func SetHeader(w HttpResponseWriter)

func SetServer

func SetServer(server string)

Types

type HttpHandler

type HttpHandler interface {
	ServeHTTP(HttpResponseWriter, *HttpRequest)
}

type HttpRequest

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

type HttpResponseWriter

type HttpResponseWriter interface {
	Write([]byte) (int, error)
}

Jump to

Keyboard shortcuts

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