Documentation ¶
Overview ¶
Package handler defines the gRPC endpoint handlers for the Credentials service.
Index ¶
- type Config
- type Credentials
- func (a *Credentials) Create(ctx context.Context, in *credentials.Credential, ...) error
- func (a *Credentials) InvalidCredential() error
- func (a *Credentials) InvalidCredentialType(credentialType credentials.CredentialType) error
- func (a *Credentials) Update(ctx context.Context, in *credentials.CredentialUpdate, ...) error
- func (a *Credentials) Validate(ctx context.Context, in *credentials.Credential, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
MongoURL string `json:"mongourl"`
}
Config contains the configuration for an instance of the Credentials service handlers.
type Credentials ¶
type Credentials struct { *Config *micro.Service // contains filtered or unexported fields }
Credentials defines the Credentials service.
func New ¶
func New(conf *Config, service *micro.Service) (*Credentials, error)
New creates a new instance of the Credentials service handlers.
func (*Credentials) Create ¶
func (a *Credentials) Create( ctx context.Context, in *credentials.Credential, out *credentials.CredentialResponse, ) error
Create inserts a new Credential object into the database.
func (*Credentials) InvalidCredential ¶
func (a *Credentials) InvalidCredential() error
InvalidCredential returns a 400 Bad Request error if the given credentials could not be validated.
func (*Credentials) InvalidCredentialType ¶
func (a *Credentials) InvalidCredentialType(credentialType credentials.CredentialType) error
InvalidCredentialType returns a 400 Bad Request error if the given credentials contained an invalid CredentialType value.
func (*Credentials) Update ¶
func (a *Credentials) Update( ctx context.Context, in *credentials.CredentialUpdate, out *credentials.CredentialResponse, ) error
Update updates a set of credentials stored in the database.
func (*Credentials) Validate ¶
func (a *Credentials) Validate( ctx context.Context, in *credentials.Credential, out *credentials.CredentialResponse, ) error
Validate validates the given Credential object against the database-stored value.