handler

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2020 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package handler defines the gRPC endpoint handlers for the Credentials service.

Index

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

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

Update updates a set of credentials stored in the database.

func (*Credentials) Validate

Validate validates the given Credential object against the database-stored value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL