dbmodels

package
v0.0.0-...-e341e2a Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

type Endpoint struct {
	Id bson.ObjectId `bson:"_id" json:"id"`

	URLPath        string                      `bson:"urlPath" json:"urlPath"`
	UserId         bson.ObjectId               `bson:"userId,omitempty" json:"userId"`
	Name           string                      `bson:"name" json:"name"`
	Description    string                      `bson:"description" json:"description"`
	Authentication EndpointAuth                `bson:"authentication" json:"authentication"`
	Enabled        bool                        `bson:"enabled" json:"enabled"`
	DateCreated    time.Time                   `bson:"dateCreated" json:"dateCreated"`
	REST           map[string]EndpointResponse `bson:"rest" json:"rest"`
}

func (*Endpoint) DeserializeJson

func (endpoint *Endpoint) DeserializeJson(obj []byte) error

func (*Endpoint) Equal

func (endpoint *Endpoint) Equal(otherEndpoint Endpoint) bool

func (*Endpoint) SerializeJson

func (endpoint *Endpoint) SerializeJson() ([]byte, error)

type EndpointAuth

type EndpointAuth struct {
	Username string `bson:"username" json:"username"`
	Password string `bson:"password" json:"password"`
}

func (EndpointAuth) Equal

func (endpointAuth EndpointAuth) Equal(otherEndpointAuth EndpointAuth) bool

type EndpointResponse

type EndpointResponse struct {
	StatusCode  int           `bson:"statusCode" json:"statusCode"`
	Delay       time.Duration `bson:"delay" json:"delay"`
	Response    string        `bson:"response" json:"response"`
	SourceCode  string        `bson:"sourceCode" json:"sourceCode"`
	ContentType string        `bson:"contentType" json:"contentType"`
}

func NewEndpointResponse

func NewEndpointResponse(method string) EndpointResponse

func (EndpointResponse) Equal

func (endpointResponse EndpointResponse) Equal(otherEndpointResponse EndpointResponse) bool

func (EndpointResponse) GetApiFunction

func (endpointResponse EndpointResponse) GetApiFunction(method string) string

type RequestHistory

type RequestHistory struct {
	Id bson.ObjectId `bson:"_id" json:"id"`

	EndpointId          bson.ObjectId       `bson:"endpointId,omitempty" json:"endpointId"`
	RequestDate         time.Time           `bson:"requestDate" json:"requestDate"`
	HTTPMethod          string              `bson:"httpMethod" json:"httpMethod"`
	Header              map[string][]string `bson:"header" json:"header"`
	Parameters          url.Values          `bson:"parameters" json:"parameters"`
	Body                string              `bson:"body" json:"body"`
	ResponseStatusCode  int                 `bson:"responseStatusCode" json:"responseStatusCode"`
	ResponseMessage     string              `bson:"responseMessage" json:"responseMessage"`
	ResponseContentType string              `bson:"responseContentType" json:"responseContentType"`
}

func (*RequestHistory) DeserializeJson

func (requestHistory *RequestHistory) DeserializeJson(obj []byte) error

func (*RequestHistory) Equal

func (requestHistory *RequestHistory) Equal(otherRequestHistory RequestHistory) bool

func (*RequestHistory) SerializeJson

func (requestHistory *RequestHistory) SerializeJson() ([]byte, error)

type User

type User struct {
	Id bson.ObjectId `bson:"_id" json:"id"`

	Username   string `bson:"username" json:"username"`
	Password   string `bson:"password" json:"password"`
	FirstName  string `bson:"firstName" json:"firstName"`
	LastName   string `bson:"lastName" json:"lastName"`
	Email      string `bson:"email" json:"email"`
	FacebookId string `bson:"facebookId" json:"facebookId"`
	GoogleId   string `bson:"googleId" json:"googleId"`
}

func (*User) DeserializeJson

func (user *User) DeserializeJson(obj []byte) error

func (*User) Equal

func (user *User) Equal(otherUser User) bool

func (*User) SerializeJson

func (user *User) SerializeJson() ([]byte, error)

type UserSession

type UserSession struct {
	Id bson.ObjectId `bson:"_id" json:"id"`

	UserId bson.ObjectId `bson:"userId,omitempty" json:"userId"`
	Token  string        `bson:"token" json:"token"`
	Time   time.Time     `bson:"time" json:"time"`
}

func (*UserSession) DeserializeJson

func (userSession *UserSession) DeserializeJson(obj []byte) error

func (*UserSession) Equal

func (userSession *UserSession) Equal(otherUserSession UserSession) bool

func (*UserSession) SerializeJson

func (userSession *UserSession) SerializeJson() ([]byte, error)

Jump to

Keyboard shortcuts

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