api

package
v0.0.0-...-02cf16a Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2015 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteJsonResponse

func WriteJsonResponse(rw http.ResponseWriter, status int, body interface{})

func WriteJsonResponseWithStatus

func WriteJsonResponseWithStatus(rw http.ResponseWriter, body WithStatus)

Types

type AuthFlow

type AuthFlow struct {
	Stages []LoginType `json:"stages,omitempty"`
	Type   LoginType   `json:"type"`
}

type AuthFlows

type AuthFlows struct {
	Flows []AuthFlow `json:"flows"`
}

type CreateRoomResponse

type CreateRoomResponse struct {
	RoomId    ct.RoomId `json:"room_id"`
	RoomAlias *ct.Alias `json:"room_alias,omitempty"`
}

type Endpoint

type Endpoint interface {
	Register(mux *httprouter.Router)
}

func NewAuthEndpoint

func NewAuthEndpoint(
	userService interfaces.UserService,
	tokenService interfaces.TokenService,
) Endpoint

func NewEventsEndpoint

func NewEventsEndpoint(
	userService interfaces.UserService,
	tokenService interfaces.TokenService,
	eventService interfaces.EventService,
	syncService interfaces.SyncService,
) Endpoint

func NewPresenceEndpoint

func NewPresenceEndpoint(
	users interfaces.UserService,
	tokens interfaces.TokenService,
	presences interfaces.PresenceService,
) Endpoint

func NewProfileEndpoint

func NewProfileEndpoint(
	users interfaces.UserService,
	tokens interfaces.TokenService,
	profiles interfaces.ProfileService,
) Endpoint

func NewRoomsEndpoint

func NewRoomsEndpoint(
	userService interfaces.UserService,
	tokenService interfaces.TokenService,
	roomService interfaces.RoomService,
	syncService interfaces.SyncService,
	eventService interfaces.EventService,
) Endpoint

type JsonBodyHandler

type JsonBodyHandler func(req *http.Request, params httprouter.Params, body interface{}) interface{}

type JsonHandler

type JsonHandler func(req *http.Request, params httprouter.Params) interface{}

type LoginType

type LoginType string
const (
	LoginTypePassword LoginType = "m.login.password"
	LoginTypeEmail              = "m.login.email.identity"
)

type OkStatus

type OkStatus struct{}

func (*OkStatus) Status

func (s *OkStatus) Status() int

type WithStatus

type WithStatus interface {
	Status() int
}

Jump to

Keyboard shortcuts

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