design

package
v0.0.0-...-04d3a30 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APIKey = APIKeySecurity("api_key", func() {
	Header("secret-key")
})

APIKey defines a security scheme using an API key (shared secret). The scheme uses the "secret-key" header to lookup the key.

View Source
var RegisterUser = MediaType("application/vnd.registerUser", func() {
	Description("This will be a common response for most the user end points")
	Attributes(func() {
		Attribute("name", String, "Input name")
		Attribute("email", String, "Input email")
		Attribute("password", String, "Input password")
		Attribute("re_password", String, "Re-enter password")
		Required("name", "email", "password", "re_password")
	})

	View("default", func() {
		Attribute("name")
		Attribute("email")
		Attribute("password")
		Attribute("re_password")
	})
})
View Source
var UserCommonResponseMedia = MediaType("application/vnd.userCommonResponse", func() {
	Description("This will be a common response for most the user end points")
	Attributes(func() {
		Attribute("code", String, "Response code")
		Attribute("message", String, "Response Message")
		Attribute("status", Integer, "Error Code")
		Required("code", "message", "status")
	})

	View("default", func() {
		Attribute("code")
		Attribute("message")
		Attribute("status")
	})
})

UserCommonResponseMedia : This will be a common response for most the user end points

View Source
var UserDataResponse = MediaType("application/vnd.userDataResponse", func() {
	Description("This will be response when user/info endpoint called")
	Attributes(func() {
		Attribute("code", String, "Response code")
		Attribute("message", String, "Response Message")
		Attribute("status", Integer, "Error Code")
		Attribute("data", UserType, "User Info")
		Required("code", "message", "status", "data")
	})

	View("default", func() {
		Attribute("code")
		Attribute("message")
		Attribute("status")
		Attribute("data")
	})
})

UserDataResponse : this will be output for user info api call

View Source
var UserLoginResponseMedia = MediaType("application/vnd.loginResponse", func() {
	Description("After login response")
	Attributes(func() {
		Attribute("code", String, "Response code")
		Attribute("message", String, "Response Message")
		Attribute("status", Integer, "Error Code")
		Attribute("secret_key", String, "Secret key")
		Required("code", "message", "status", "secret_key")
	})

	View("default", func() {
		Attribute("code")
		Attribute("message")
		Attribute("status")
		Attribute("secret_key")
	})
})

UserLoginResponseMedia : if user logged in successfully secret_key will be sent else error

View Source
var UserType = Type("UserPayload", func() {
	Description("User data payload")
	Attribute("UserId", Integer, "User Id")
	Attribute("UserName", String, "User Name")
	Attribute("UserEmail", String, "User Email")
	Required("UserId", "UserName", "UserEmail")
})

UserType : contain information of user

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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