Documentation ¶
Index ¶
- Constants
- Variables
- func GetRequestVar(req *http.Request, name string) (string, bool)
- func GetRequestVars(req *http.Request) map[string]string
- func WriteErrorAsJSON(rw http.ResponseWriter, err error) error
- func WriteResourceAsCollectionResourceResponseJSON(rw http.ResponseWriter, req *http.Request, values interface{}, ...) error
- func WriteResourceAsItemResourceResponseJSON(rw http.ResponseWriter, req *http.Request, item interface{}) error
- func WriteResourceAsJSON(rw http.ResponseWriter, resource interface{}) error
- type BridgeMCUMCClientsResource
- type Collection
- type CollectionResource
- type ErrorResource
- type ErrorWithCodeAndMessage
- type Item
- type ItemResource
Constants ¶
View Source
const (
ErrorCodeUnspecifiedError = "ErrorUnspecifiedError"
)
Variables ¶
Functions ¶
func WriteErrorAsJSON ¶
func WriteErrorAsJSON(rw http.ResponseWriter, err error) error
func WriteResourceAsCollectionResourceResponseJSON ¶
func WriteResourceAsItemResourceResponseJSON ¶
func WriteResourceAsItemResourceResponseJSON(rw http.ResponseWriter, req *http.Request, item interface{}) error
func WriteResourceAsJSON ¶
func WriteResourceAsJSON(rw http.ResponseWriter, resource interface{}) error
Types ¶
type BridgeMCUMCClientsResource ¶
type BridgeMCUMCClientsResource struct {
CollectionResource
}
type Collection ¶
type Collection interface{}
type CollectionResource ¶
type CollectionResource struct { ODataContext string `json:"@odata.context"` ODataNextLink string `json:"@odata.nextLink,omitempty"` Values Collection `json:"values"` }
func NewCollectionResource ¶
func NewCollectionResource(values Collection, req *http.Request, nextLink *string) *CollectionResource
type ErrorResource ¶
type ErrorResource struct {
Error interface{}
}
func NewErrorResource ¶
func NewErrorResource(err error) *ErrorResource
type ErrorWithCodeAndMessage ¶
type ErrorWithCodeAndMessage struct { Code string `json:"code"` Message string `json:"message"` // contains filtered or unexported fields }
func NewErrorWithCodeAndMessage ¶
func NewErrorWithCodeAndMessage(code string, message string, err error) *ErrorWithCodeAndMessage
func (*ErrorWithCodeAndMessage) Error ¶
func (err *ErrorWithCodeAndMessage) Error() string
func (*ErrorWithCodeAndMessage) Unwrap ¶
func (err *ErrorWithCodeAndMessage) Unwrap() error
type Item ¶
type Item interface{}
Click to show internal directories.
Click to hide internal directories.