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 HandleAuthenticationError(ctx context.Context, err error) error
- 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 HandleJSONEncodingError(ctx context.Context, err error) error
- func HandleMessagingPubError(ctx context.Context, err error) error
- func HandleMessagingReplyError(ctx context.Context, err error) error
- func HandleMessagingReqError(ctx context.Context, err error) error
- func HandleMessagingSubError(ctx context.Context, err error) error
- func HandleNotFoundError(ctx context.Context, err error) error
- func HandleOauthExchangeError(ctx context.Context, err error) error
- func HandleUpdateArgError(ctx context.Context, err error) error
- func HandleUpdateError(ctx context.Context, err error) error
- func HandleUserRetrievalError(ctx context.Context, err error) error
- func NatsFlag() []cli.Flag
- func ProtoTimeStamp(ts *timestamppb.Timestamp) time.Time
- func TimestampProto(t time.Time) *timestamppb.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") //ErrAuthentication represents the absence of valid authentication credentials ErrAuthentication = newError("Invalid credentials for authentication") //ErrMessagingReply represents any error in request reply messaging ErrMessagingReply = newError("messaging reply error") //ErrMessagingReq represents any error in request reply messaging ErrMessagingReq = newError("messaging request error") //ErrMessagingSub represents any error in publish subscribe messaging ErrMessagingSub = newError("messaging subscription error") //ErrMessagingPub represents any error in publish subscribe messaging ErrMessagingPub = newError("messaging publication error") //ErrOuthExchange represents any error in exchanging a code for a token with the oauth server ErrOauthExchange = newError("Unable to exchange token for code") //ErrUserRetrieval represents any error in retrieving user information from an oauth provider ErrUserRetrieval = newError("Unable to retrieve user information") )
Functions ¶
func AssignFieldsToStructs ¶
func AssignFieldsToStructs(from interface{}, to interface{})
AssignFieldsToStructs copy fields value between structure
func CheckNoRows ¶
func HandleAuthenticationError ¶ added in v1.2.0
func HandleJSONEncodingError ¶ added in v1.3.0
func HandleMessagingPubError ¶ added in v1.2.0
func HandleMessagingReplyError ¶ added in v1.2.0
func HandleMessagingReqError ¶ added in v1.2.0
func HandleMessagingSubError ¶ added in v1.2.0
func HandleOauthExchangeError ¶ added in v1.2.0
func HandleUserRetrievalError ¶ added in v1.2.0
func NatsFlag ¶ added in v1.1.0
NatsFlag returns a cli.Flag slice for using in the command line arguments
func ProtoTimeStamp ¶
func ProtoTimeStamp(ts *timestamppb.Timestamp) time.Time
func TimestampProto ¶
func TimestampProto(t time.Time) *timestamppb.Timestamp
Types ¶
Click to show internal directories.
Click to hide internal directories.