Documentation ¶
Index ¶
- Constants
- Variables
- func MarshalJson(v interface{}) (bytes []byte, err error)
- func ReadError(r io.Reader) (err error)
- func ReadResponse(r io.Reader, v interface{})
- func WriteError(w http.ResponseWriter, statusCode int, v interface{})
- func WriteResponse(w http.ResponseWriter, statusCode int, v interface{})
- type CreateLogForm
- type CreateLogResponse
- type Error
- type GetLogResponse
- type ListLogsResponse
- type LogConfig
- type LogInfo
- type ParamsError
- type ReadRecordParams
- type ReadRecordsBatchParams
- type ReadRecordsLinesParams
- type ReadRecordsTCPParams
- type ReadRecordsWSParams
- type RestoreLogParams
- type WriteRecordResponse
- type WriteRecordsBatchResponse
- type WriteRecordsLinesResponse
Constants ¶
View Source
const ( TimeoutHeaderName = "X-Styx-Timeout" RecordLinesMediaType = "application/vnd.styx.line-delimited" RecordBinaryMediaType = "application/vnd.styx.binary-records" StyxProtocolString = "styx/0" )
Variables ¶
View Source
var ( ErrUnknownError = NewError(defaultErrorCode, defaultErrorMessage) ErrMethodNotAllowed = NewError(methodNotAllowedErrorCode, methodNotAllowedErrorMessage) ErrNotFound = NewError(notFoundErrorCode, notFoundErrorMessage) ErrLogExist = NewError(logExistErrorCode, logExistErrorMessage) ErrLogNotFound = NewError(logNotFoundErrorCode, logNotFoundErrorMessage) ErrLogNotAvailable = NewError(logNotAvailableErrorCode, logNotAvailableErrorMessage) ErrLogInvalidName = NewError(logInvalidNameCode, logInvalidNameMessage) ErrMissingContentLength = NewError(missingLengthErrorCode, missingLengthErrorMessage) )
View Source
var (
ErrInvalidWhence = errors.New("invalid whence")
)
Functions ¶
func MarshalJson ¶
func ReadResponse ¶
func WriteError ¶
func WriteError(w http.ResponseWriter, statusCode int, v interface{})
func WriteResponse ¶
func WriteResponse(w http.ResponseWriter, statusCode int, v interface{})
Types ¶
type CreateLogForm ¶
type CreateLogResponse ¶
type CreateLogResponse LogInfo
type GetLogResponse ¶
type GetLogResponse LogInfo
type ListLogsResponse ¶
type ListLogsResponse []LogInfo
type LogConfig ¶
type LogConfig struct { MaxRecordSize int `schema:"max_record_size"` IndexAfterSize int64 `schema:"index_after_size"` SegmentMaxCount int64 `schema:"segment_max_count"` SegmentMaxSize int64 `schema:"segment_max_size"` SegmentMaxAge int64 `schema:"segment_max_age"` LogMaxCount int64 `schema:"log_max_count"` LogMaxSize int64 `schema:"log_max_size"` LogMaxAge int64 `schema:"log_max_age"` }
type ParamsError ¶
type ParamsError Error
func NewParamsError ¶
func NewParamsError(err error) (e *ParamsError)
func (*ParamsError) Error ¶
func (e *ParamsError) Error() (m string)
type ReadRecordParams ¶
type ReadRecordParams struct { Whence log.Whence `schema:"whence"` Position int64 `schema:"position"` }
func (ReadRecordParams) Validate ¶
func (p ReadRecordParams) Validate() (err error)
type ReadRecordsBatchParams ¶
type ReadRecordsBatchParams struct { Whence log.Whence `schema:"whence"` Position int64 `schema:"position"` Count int64 `schema:"count"` Follow bool `schema:"follow"` }
func (ReadRecordsBatchParams) Validate ¶
func (p ReadRecordsBatchParams) Validate() (err error)
type ReadRecordsLinesParams ¶
type ReadRecordsLinesParams ReadRecordsBatchParams
func (ReadRecordsLinesParams) Validate ¶
func (p ReadRecordsLinesParams) Validate() (err error)
type ReadRecordsTCPParams ¶
type ReadRecordsTCPParams struct { Whence log.Whence `schema:"whence"` Position int64 `schema:"position"` Count int64 `schema:"count"` Follow bool `schema:"follow"` }
func (ReadRecordsTCPParams) Validate ¶
func (p ReadRecordsTCPParams) Validate() (err error)
type ReadRecordsWSParams ¶
type ReadRecordsWSParams ReadRecordsTCPParams
func (ReadRecordsWSParams) Validate ¶
func (p ReadRecordsWSParams) Validate() (err error)
type RestoreLogParams ¶
type RestoreLogParams struct {
Name string `schema:"name,required"`
}
type WriteRecordResponse ¶
type WriteRecordsBatchResponse ¶
type WriteRecordsBatchResponse WriteRecordResponse
type WriteRecordsLinesResponse ¶
type WriteRecordsLinesResponse WriteRecordResponse
Click to show internal directories.
Click to hide internal directories.