Documentation
¶
Index ¶
- Variables
- func Handler(w http.ResponseWriter, r *http.Request)
- func Marshal(in interface{}) (string, error)
- func Setup_services()
- func UnMarshal(in string, out interface{}) (interface{}, error)
- type Auth_1_Session_Get_Response
- type Auth_1_Session_Post_Request
- type Auth_1_Session_Post_Response
- type RequestLog
- type Service_Definition
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Services []Service_Definition = []Service_Definition{}
)
Functions ¶
func Setup_services ¶
func Setup_services()
Types ¶
type Auth_1_Session_Get_Response ¶
type Auth_1_Session_Get_Response struct {
Self string `json:"self"`
Name string `json:"name"`
LoginInfo struct {
FailedLoginCount int `json:"failedLoginCount"`
LoginCount int `json:"loginCount"`
LastFailedLoginTime string `json:"lastFailedLoginTime"`
PreviousLoginTime string `json:"previousLoginTime"`
} `json:"loginInfo"`
}
type Auth_1_Session_Post_Request ¶
type Auth_1_Session_Post_Request struct {
Username string `json:"username"`
Password string `json:"password"`
}
func (*Auth_1_Session_Post_Request) Validate ¶
func (a *Auth_1_Session_Post_Request) Validate()
type Auth_1_Session_Post_Response ¶
type Auth_1_Session_Post_Response struct {
Session struct {
Name string `json:"name"`
Value string `json:"value"`
} `json:"session"`
LoginInfo struct {
FailedLoginCount int `json:"failedLoginCount"`
LoginCount int `json:"loginCount"`
LastFailedLoginTime string `json:"lastFailedLoginTime"`
PreviousLoginTime string `json:"previousLoginTime"`
} `json:"loginInfo"`
}
type RequestLog ¶
type RequestLog struct {
Method string
Host string
Path string
Proto string
ContentLength int64
ContentType string `json:"Content-Type"`
UserAgent string `json:"User-Agent"`
RemoteAddr string
InCookies []string
OutCookies []string
InJson string
OutJson string
Status int
}
func RequestLog_from_request ¶
func RequestLog_from_request(r *http.Request) RequestLog
Initialize new RequestLog and fill in some details from request
type Service_Definition ¶
type Service_Definition struct {
Method string
URI *regexp.Regexp
Internal_Protocol string
Internal_Host string
External_Protocol string
External_Host string
Caller *regexp.Regexp // checked against RemoteAddr, form host:port!
SetCookies bool
In_Object interface{}
Out_Object interface{}
}
Method: GET | PUT | POST | DELETE Uri: Regexp for path Internal_Protocol: http | https Internal_Host: Address used to connect to morganfield External_Protocol: http | https External_Host: Address used to connect to remote REST service Caller: Regexp for checking source of requests SetCookies: Should the cookie data be copied back and forth In_Object: Input JSON object (see objects.go) Out_Object: Output JSON object (see objects.go)
func (Service_Definition) Matches_Request ¶
func (s Service_Definition) Matches_Request(r *http.Request) bool
Service is considered to match request, when the following match: method, url path, target host, remote address
Source Files
¶
Click to show internal directories.
Click to hide internal directories.
