Documentation
¶
Overview ¶
Package aphgrpc provides various interfaces, functions, types for building and working with gRPC services.
Index ¶
- Constants
- Variables
- func AssignFieldsToStructs(from interface{}, to interface{})
- func CheckNoRows(err error) bool
- func HandleDeleteError(ctx context.Context, err error) error
- func HandleError(ctx context.Context, err error) error
- func HandleExistError(ctx context.Context, err error) error
- func HandleFilterParamError(ctx context.Context, err error) error
- func HandleGenericError(ctx context.Context, err error) error
- func HandleGetArgError(ctx context.Context, err error) error
- func HandleGetError(ctx context.Context, err error) error
- func HandleInsertArgError(ctx context.Context, err error) error
- func HandleInsertError(ctx context.Context, err error) error
- func HandleInvalidParamError(ctx context.Context, err error) error
- func HandleNotFoundError(ctx context.Context, err error) error
- func HandleUpdateArgError(ctx context.Context, err error) error
- func HandleUpdateError(ctx context.Context, err error) error
- func NatsFlag() []cli.Flag
- func ProtoTimeStamp(ts *timestamp.Timestamp) time.Time
- func TimestampProto(t time.Time) *timestamp.Timestamp
- type Option
- type Service
- type ServiceOptions
Constants ¶
View Source
const (
// MetaKey is the key used for storing all metadata
MetaKey = "error"
)
Variables ¶
View Source
var ( //ErrDatabaseQuery represents database query related errors ErrDatabaseQuery = newError("Database query error") //ErrDatabaseInsert represents database insert related errors ErrDatabaseInsert = newError("Database insert error") //ErrDatabaseUpdate represents database update related errors ErrDatabaseUpdate = newError("Database update error") //ErrDatabaseDelete represents database update delete errors ErrDatabaseDelete = newError("Database delete error") //ErrNotFound represents the absence of an HTTP resource ErrNotFound = newError("Resource not found") //ErrExists represents the presence of an HTTP resource ErrExists = newError("Resource already exists") //ErrJSONEncoding represents any json encoding error ErrJSONEncoding = newError("Json encoding error") //ErrStructMarshal represents any error with marshalling structure ErrStructMarshal = newError("Structure marshalling error") //ErrIncludeParam represents any error with invalid include query parameter ErrIncludeParam = newErrorWithParam("Invalid include query parameter", "include") //ErrSparseFieldSets represents any error with invalid sparse fieldsets query parameter ErrFields = newErrorWithParam("Invalid field query parameter", "field") //ErrFilterParam represents any error with invalid filter query paramter ErrFilterParam = newErrorWithParam("Invalid filter query parameter", "filter") //ErrNotAcceptable represents any error with wrong or inappropriate http Accept header ErrNotAcceptable = newError("Accept header is not acceptable") //ErrUnsupportedMedia represents any error with unsupported media type in http header ErrUnsupportedMedia = newError("Media type is not supported") //ErrInValidParam represents any error with validating input parameters ErrInValidParam = newError("Invalid parameters") //ErrRetrieveMetadata represents any error to retrieve grpc metadata from the running context ErrRetrieveMetadata = errors.New("unable to retrieve metadata") //ErrXForwardedHost represents any failure or absence of x-forwarded-host HTTP header in the grpc context ErrXForwardedHost = errors.New("x-forwarded-host header is absent") )
Functions ¶
func AssignFieldsToStructs ¶
func AssignFieldsToStructs(from interface{}, to interface{})
AssignFieldsToStructs copy fields value between structure
func CheckNoRows ¶
Types ¶
type Service ¶
func (*Service) GetResourceName ¶
type ServiceOptions ¶
Click to show internal directories.
Click to hide internal directories.