Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var InternalError = status.Error(codes.Internal, "something went wrong, please try again later")
Functions ¶
func NewGrpcConnection ¶
func NewGrpcConnection(cfg *ServiceConfig) *grpc.ClientConn
NewGrpcConnection establishes a connection with a grpc service.
func ValidationError ¶
ValidationError takes a field error and returns an InvalidArgument grpc error.
Returns nil if err is nil.
func ValidationErrors ¶
ValidationErrors takes the validation error output and returns an InvalidArgument grpc error. The grpc description contains a summary, error details are stored as FieldViolations.
Returns nil if len(errs) == 0.
Types ¶
type ServiceConfig ¶
type TLSConfig ¶
type TLSConfig struct {
Enable bool `yaml:"enable"`
}
TLSConfig contains the TLS configuration.
Currently TLS can only be enabled/disabled but cannot be configured with any custom TLS certificates. In practice this means the default OS root certificates are used which should suffice for most use cases. It does mean any self-signed certificate is rejected.