Documentation ¶
Index ¶
Constants ¶
const ( AuthorizationResource = "authorization_endpoint" UAAResource = "uaa" )
const ( GetSSHPasscodeRequest = "GetSSHPasscode" GetGroupsRequest = "GetGroups" PostOAuthTokenRequest = "PostOAuthToken" PostUserRequest = "PostUser" DeleteUserRequest = "DeleteUser" GetUserRequest = "GetUser" GetUsersRequest = "GetUsers" PutUserRequest = "PutUserRequest" PutUserPasswordRequest = "PutUserPassword" PostGroupMemberRequest = "PostGroupMember" DeleteGroupMemberRequest = "DeleteGroupMember" )
Variables ¶
var APIRoutes = []Route{ {Path: "/Groups", Method: http.MethodGet, Name: GetGroupsRequest, Resource: UAAResource}, {Path: "/Groups/:group_guid/members", Method: http.MethodPost, Name: PostGroupMemberRequest, Resource: UAAResource}, {Path: "/Groups/:group_guid/members/:user_guid", Method: http.MethodDelete, Name: DeleteGroupMemberRequest, Resource: UAAResource}, {Path: "/Users", Method: http.MethodPost, Name: PostUserRequest, Resource: UAAResource}, {Path: "/Users", Method: http.MethodGet, Name: GetUsersRequest, Resource: UAAResource}, {Path: "/Users/:user_guid", Method: http.MethodDelete, Name: DeleteUserRequest, Resource: UAAResource}, {Path: "/Users/:user_guid", Method: http.MethodGet, Name: GetUserRequest, Resource: UAAResource}, {Path: "/Users/:user_guid", Method: http.MethodPut, Name: PutUserRequest, Resource: UAAResource}, {Path: "/Users/:user_guid/password", Method: http.MethodPut, Name: PutUserPasswordRequest, Resource: UAAResource}, {Path: "/oauth/authorize", Method: http.MethodGet, Name: GetSSHPasscodeRequest, Resource: UAAResource}, {Path: "/oauth/token", Method: http.MethodPost, Name: PostOAuthTokenRequest, Resource: AuthorizationResource}, }
APIRoutes is a list of routes used by the router to construct request URLs.
Functions ¶
This section is empty.
Types ¶
type Params ¶
Params map path keys to values. For example, if your route has the path pattern:
/person/:person_id/pets/:pet_type
Then a correct Params map would lool like:
router.Params{ "person_id": "123", "pet_type": "cats", }
type Route ¶
type Route struct { // Name is a key specifying which HTTP route the router should associate with // the endpoint at runtime. Name string // Method is any valid HTTP method Method string // Path contains a path pattern Path string // Resource is a key specifying which resource root the router should // associate with the endpoint at runtime. Resource string }
Route defines the property of a Cloud Controller V3 endpoint.
Method can be one of the following:
GET HEAD POST PUT PATCH DELETE CONNECT OPTIONS TRACE
Path conforms to Pat-style pattern matching. The following docs are taken from http://godoc.org/github.com/bmizerany/pat#PatternServeMux
Path Patterns may contain literals or captures. Capture names start with a colon and consist of letters A-Z, a-z, _, and 0-9. The rest of the pattern matches literally. The portion of the URL matching each name ends with an occurrence of the character in the pattern immediately following the name, or a /, whichever comes first. It is possible for a name to match the empty string.
Example pattern with one capture:
/hello/:name
Will match:
/hello/blake /hello/keith
Will not match:
/hello/blake/ /hello/blake/foo /foo /foo/bar
Example 2:
/hello/:name/
Will match:
/hello/blake/ /hello/keith/foo /hello/blake /hello/keith
Will not match:
/foo /foo/bar