api

package
v0.0.0-...-afa2af8 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2015 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackboneJSON

func BackboneJSON(things []things.Thing, state State, fields []string) interface{}

func BootstrapHandler

func BootstrapHandler(w http.ResponseWriter, r *http.Request)

func Errr

func Errr(w http.ResponseWriter, r *http.Request)

func Hello

func Hello(w http.ResponseWriter, r *http.Request)

func HostAndPort

func HostAndPort(s string) string

func KVfromRequestForm

func KVfromRequestForm(form url.Values, highlights ...string) (kv map[string]interface{}, highlight interface{})

func KVfromRequestJSON

func KVfromRequestJSON(request_body io.ReadCloser, highlights ...string) (kv map[string]interface{}, highlight interface{})

func Router

func Router(w http.ResponseWriter, r *http.Request)

func ScopeId

func ScopeId(scope things.Scope) (id string)

func ScopeToOrigin

func ScopeToOrigin(origin_url string, person_id int64) (ancestors []pacific.Ancestor)

Types

type Origin

type Origin struct {
	Scope         *things.Scope `datastore:"-" sql:"-" json:"-"`
	OriginId      string
	PersonId      int64
	URL           string
	RedirectUrl   string
	Nil           bool
	*things.Thing `datastore:"-" sql:"-" json:"-"`
}

func (Origin) Kv

func (origin Origin) Kv(key string) (value string)

func (Origin) Save

func (origin Origin) Save()

type Person

type Person struct {
	*kolkata.Person `datastore:"-" sql:"-" json:"-"`
	Scope           *things.Scope `datastore:"-" sql:"-" json:"-"`
	Username        string
}

func (Person) Save

func (person Person) Save()

func (Person) ToThing

func (person Person) ToThing() (thing things.Thing)

type State

type State struct {
	Bootstrap    string
	Writer       http.ResponseWriter
	Request      *http.Request
	Context      pacific.Context
	CurrentScope things.Scope
	AcceptType   string
	ContentType  string
	Path         string
	PersonId     int64
	PersonIdStr  string
	Host         string
	Services     map[string]interface{}
	Person       kolkata.Person
	ThePerson    Person
	NewUser      bool
	Origin       Origin
	OriginStr    string
	Dev          bool
}

func CreateState

func CreateState(w http.ResponseWriter, r *http.Request) (state State)

func ScopeAndState

func ScopeAndState(w http.ResponseWriter, r *http.Request) (src_person kolkata.Person, scope things.Scope, state_ptr State)

func (*State) InitPerson

func (state *State) InitPerson(src_person *kolkata.Person, scope *things.Scope, username_ar ...string) (person Person)

func (State) NewOrigin

func (state State) NewOrigin(host string) (origin Origin)

func (*State) NewPerson

func (state *State) NewPerson(username string, scope *things.Scope, src_person *kolkata.Person) (person Person)

func (State) PutPostHandler

func (state State) PutPostHandler() (thing things.Thing, err error)

func (*State) Scope

func (state *State) Scope() (scope things.Scope)

func (*State) ScopeToPerson

func (state *State) ScopeToPerson() (scope things.Scope)

func (State) SetOrigin

func (state State) SetOrigin() (origin Origin)

type WS

type WS struct{}

func (*WS) ServeHTTP

func (m *WS) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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