Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var APIKeyAuth = APIKeySecurity("api_key", func() {
Description("Secures endpoint by requiring an API key.")
})
APIKeyAuth defines a security scheme that uses API keys.
View Source
var AppVersion = Type("version", func() {
Description("Application version information")
Attribute("version", String, "Application version", func() {
Example("1.0")
})
Attribute("build_time", String, "Application build time", func() {
Example("")
})
})
View Source
var BadRequest = Type("bad-request", func() {
Description("bad-request indicates the values provided are invalid")
Attribute("name", String, "Name of error", func() { Example("bad request") })
Attribute("message", String, "Error message", func() {
Example("bad request")
})
Attribute("detail", String, "Error details", func() {
Example("Failed to validate information. Cannot continue.")
})
Required("message", "detail", "name")
})
View Source
var DomainIn = Type("Domain", func() {
Description("Domain type")
Attribute("domain_name", String, func() { Example("tawny.com", "123.123.123.123") })
Attribute("project", String, func() {
Example(
"my-project. Unique identifier provided by tawny once a project or application is created.",
)
})
Attribute("email_address", String, func() { Example("me@tawny.com") })
Attribute("protocol", String, func() { Example("http"); Example("https"); Default("https") })
Attribute("port", String, func() {
Example("8080")
Description(
"Port to listen on. Must match the port of the service which is being exposed. " +
"Mandatory for IP only addressing and cannot be 80 or 443 unless a domain name is specified.",
)
})
Attribute("certificate_type", String, func() {
Default("production")
Example("production")
Description("Let's Encrypt server type. Accepts staging or production. " +
"Only use staging for testing and making sure your domain is accessible by Let's Encrypt. " +
"Rate limits are applied by Let's Encrypt on the production instance and can result in significant locks out if the limits are abused.")
})
Required("domain_name", "project")
})
View Source
var DomainResult = ResultType("application/vnd.tawny.domain", func() {
TypeName("DomainResult")
Description("A single domain result")
Attribute("domain_name", String, func() { Example("tawny.com", "123.123.123.123") })
Attribute("project", String, func() {
Example(
"my-project. Unique identifier provided by tawny once a project or application is created.",
)
})
Attribute("email_address", String, func() { Example("me@tawny.com") })
Attribute("protocol", String, func() { Example("http"); Example("https"); Default("https") })
Attribute("port", String, func() { Example("8080") })
Attribute("certificate_type", String, func() { Example("production") })
View(viewDefault, func() {
Attribute("domain_name")
Attribute("project")
Attribute("email_address")
Attribute("protocol")
Attribute("port")
Attribute("certificate_type")
})
})
View Source
var DomainsResult = ResultType("application/vnd.tawny.domains", func() { TypeName("DomainsResult") Attribute("domains", CollectionOf(DomainResult)) Attribute("metadata", PaginationMetadata) Required("domains", "metadata") })
View Source
var Forbidden = Type("forbidden", func() {
Description("forbidden indicates access to a resource was denied")
Attribute("name", String, "Name of error", func() { Example("forbidden") })
Attribute("message", String, "Error message", func() {
Example("bad request")
})
Attribute("detail", String, "Error details", func() {
Example("Failed to determine machine information. Cannot continue.")
})
Required("message", "detail", "name")
})
View Source
var NotFound = Type("not-found", func() {
Description("not-found indicates the resource matching the id does not exist.")
Attribute("id", String, "ID of device", func() {
Example("resource_1234567")
})
Attribute("name", String, "Name of error", func() { Example("not found") })
Attribute("message", String, "Error message", func() {
Example("bad request")
})
Attribute("detail", String, "Error details", func() {
Example("Resource not found")
})
Required("message", "detail", "name")
})
View Source
var Origins = []string{
"/127.0.0.1:\\d+/",
"/localhost:\\d+/",
"/192.168.(\\d+).(\\d+):\\d+/",
}
View Source
var PaginationMetadata = Type("PaginationMetadata", func() {
Attribute("total", Int32, func() { Example(25) })
Attribute("current_page", Int32, func() { Example(1) })
Attribute("first_page", Int32, func() { Example(1) })
Attribute("last_page", Int32, func() { Example(10) })
Attribute("page_size", Int32, func() { Example(20) })
Required("total", "page_size", "first_page", "current_page", "last_page")
})
View Source
var ServerError = Type("server-error", func() {
Description("server-error indicates the server encountered an error.")
Attribute("name", String, "Name of error", func() { Example("internal server error") })
Attribute("message", String, "Error message", func() {
Example("bad request")
})
Attribute("detail", String, "Error details", func() {
Example("Failed to determine machine information. Cannot continue.")
})
Required("message", "detail", "name")
})
View Source
var TeamIn = Type("Team", func() {
Description("Team object")
Attribute("name", String, "Name", func() { Example("Dream Team") })
Required("name")
})
View Source
var TeamResult = ResultType("application/vnd.tawny.team", func() { TypeName("Team") Description("A single team") Attribute("uuid", String, "Team ID", func() { Pattern(teamRx) Example("team_1234567") }) Attribute("name", String, "Name", func() { Example("Dream Team") }) Attribute("personal_team", Boolean, "personal_team", func() { Example(false) }) createdAndUpdateAtResult() Required("uuid", "name", "personal_team") View(viewDefault, func() { Attribute("uuid") Attribute("name") Attribute("personal_team") }) })
View Source
Description("unauthorized indicates authentication failed")
Attribute("message", String, "Message of the error", func() {
Example("unauthorized")
})
Required("message")
})
View Source
var UserIn = Type("User", func() {
Description("User object")
Attribute("name", String, "Name of the user", func() { Example("Daniel") })
Attribute("password", String, "ID of the user", func() { Example("fakePassword") })
Attribute("email", String, "Email of the user", func() { Example("email@example.com") })
Required("name", "password", "email")
})
View Source
var UserResult = ResultType("application/vnd.tawny.user", func() {
TypeName("UserResult")
Description("A single user")
Attribute("user_uuid", String, "User ID", func() { Example("user_1234567") })
Attribute("name", String, "name", func() { Example("Daniel") })
Attribute("email", String, "Email", func() { Example("me@gmail.com") })
Attribute("role", String, "Role", func() { Example("admin") })
createdAndUpdateAtResult()
Required("name", "email", "role")
View(viewDefault, func() {
Attribute("user_uuid")
Attribute("name")
Attribute("email")
Attribute("role")
Attribute("created_at")
Attribute("updated_at")
})
})
View Source
var UsersResult = ResultType("application/vnd.tawny.users", func() { TypeName("Users") Attributes(func() { Attribute("users", CollectionOf(UserResult)) Attribute("metadata", PaginationMetadata) Required("users", "metadata") }) })
Functions ¶
func PaginationQueryParams ¶ added in v0.0.3
PaginationQueryParams returns the current_page and page_size values
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.