Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogEntry ¶
type LogEntryList ¶
type LogEntryList struct {
LogEntries []*LogEntry `json:"log_entries" gorm:"-"`
}
func (*LogEntryList) Render ¶
func (*LogEntryList) Render(writer http.ResponseWriter, request *http.Request) error
type LogEntryRequest ¶
type LogEntryRequest struct { *LogEntry ProtectedID string `json:"id"` // override 'id' json to have more control }
LogEntryRequest is the request payload for LogEntry data model.
NOTE: It's good practice to have well defined request and response payloads so you can manage the specific inputs and outputs for clients, and also gives you the opportunity to transform data on input or output, for example on request, we'd like to protect certain fields and on output perhaps we'd like to include a computed field based on other values that aren't in the data model. Also, check out this awesome blog post on struct composition: http://attilaolah.eu/2014/09/10/json-and-struct-composition-in-go/
type LogEntryResponse ¶
type LogEntryResponse struct {
*LogEntry
}
func (*LogEntryResponse) Render ¶
func (logEntry *LogEntryResponse) Render(writer http.ResponseWriter, request *http.Request) error
Click to show internal directories.
Click to hide internal directories.