Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBQueryError ¶
type DBQueryError struct {
ElasticErrorGeneral
}
DBQueryError is error caused by any internal error of the database
func NewDBQueryError ¶
func NewDBQueryError(reason string) *DBQueryError
NewDBQueryError creates a new instance of DBQueryError
type ElasticError ¶
type ElasticError interface { error Type() string Reason() string FormatErrorResponse() interface{} }
ElasticError is a basic interface for any kind of errors produced by pg-elastic and can be represented as a JSON error report
type ElasticErrorBulk ¶
type ElasticErrorBulk struct { ElasticErrorGeneral Index string `json:"index"` Shard string `json:"shard"` IndexUUID string `json:"index_uuid"` }
ElasticErrorBulk represents a response format for JSON error report for bulk requests
func NewElasticErrorBulk ¶
func NewElasticErrorBulk(err ElasticError, index, shard, indexUUID string) *ElasticErrorBulk
NewElasticErrorBulk creates a new instance of ElasticErrorBulk
func (*ElasticErrorBulk) FormatErrorResponse ¶
func (err *ElasticErrorBulk) FormatErrorResponse() interface{}
FormatErrorResponse generates an JSON output for an error
type ElasticErrorGeneral ¶
ElasticErrorGeneral represents a response format for JSON error report 'cause' part
func (*ElasticErrorGeneral) Error ¶
func (err *ElasticErrorGeneral) Error() string
func (*ElasticErrorGeneral) FormatErrorResponse ¶
func (err *ElasticErrorGeneral) FormatErrorResponse() interface{}
FormatErrorResponse generates an JSON output for an error
func (*ElasticErrorGeneral) Reason ¶
func (err *ElasticErrorGeneral) Reason() string
Reason returns the error reason
func (*ElasticErrorGeneral) Type ¶
func (err *ElasticErrorGeneral) Type() string
Type returns name of the error type
type ElasticErrorGeneralResponse ¶
type ElasticErrorGeneralResponse struct { RootCause []ElasticErrorGeneral `json:"root_cause"` ElasticErrorGeneral }
ElasticErrorGeneralResponse represents a response format for JSON error report
type FieldMapping ¶
FieldMapping represents a processing mapping for a field
func GetFieldMapping ¶
func GetFieldMapping(mapping map[string]interface{}, fieldName string) (*FieldMapping, bool)
GetFieldMapping extracts field mapping from type mapping object
type IllegalQueryError ¶
type IllegalQueryError struct {
ElasticErrorGeneral
}
IllegalQueryError is error caused by misconstructed query
func NewIllegalQueryError ¶
func NewIllegalQueryError(reason string) *IllegalQueryError
NewIllegalQueryError creates a new instance of IllegalQueryError
type InternalError ¶
type InternalError struct {
ElasticErrorGeneral
}
InternalError is error caused by pg-elastic itself
func NewInternalError ¶
func NewInternalError(reason string) *InternalError
NewInternalError creates a new instance of InternalError
type InternalIOError ¶
type InternalIOError struct {
ElasticErrorGeneral
}
InternalIOError is error caused by any other IO operations
func NewInternalIOError ¶
func NewInternalIOError(reason string) *InternalIOError
NewInternalIOError creates a new instance of InternalIOError
type JSONWrongFormatError ¶
type JSONWrongFormatError struct {
ElasticErrorGeneral
}
JSONWrongFormatError is error caused by illegal JSON input
func NewJSONWrongFormatError ¶
func NewJSONWrongFormatError(reason string) *JSONWrongFormatError
NewJSONWrongFormatError creates a new instance of JSONWrongFormatError
type PGElasticConfig ¶
type PGElasticConfig struct { ServerPort int PostgresConfig PostgresConnectionConfig }
PGElasticConfig represents structure of the pg-elastic configuration
func ReadConfig ¶
func ReadConfig(path string) *PGElasticConfig
ReadConfig reads a configuration from the file at path