validation

package
Version: v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServerWrapper

func NewServerWrapper(upstream authProto.AuthServer, validator *validator.Validate,
	translator *ut.UniversalTranslator, validationErr cherry.ErrConstruct) authProto.AuthServer

NewServerWrapper constructs ServerWrapper

func StandardAuthValidator

func StandardAuthValidator(uni *ut.UniversalTranslator) (ret *validator.Validate)

StandardAuthValidator sets up validator to Validate requests

Types

type GinValidatorV9

type GinValidatorV9 struct {
	Validate *validator.Validate
	// contains filtered or unexported fields
}

GinValidatorV9 is a replacement for gin`s standard validator

func (*GinValidatorV9) Engine added in v1.0.3

func (v *GinValidatorV9) Engine() interface{}

func (*GinValidatorV9) ValidateStruct

func (v *GinValidatorV9) ValidateStruct(obj interface{}) error

ValidateStruct implements binding.StructValidator interface

type ServerWrapper

type ServerWrapper struct {
	// contains filtered or unexported fields
}

ServerWrapper is a special wrapper to Validate incoming requests and then call "upstream"

func (*ServerWrapper) AccessTokenByID

func (v *ServerWrapper) AccessTokenByID(ctx context.Context, req *authProto.AccessTokenByIDRequest) (*authProto.AccessTokenByIDResponse, error)

AccessTokenByID performs request validation and calls underlying method

func (*ServerWrapper) CheckToken

func (v *ServerWrapper) CheckToken(ctx context.Context, req *authProto.CheckTokenRequest) (*authProto.CheckTokenResponse, error)

CheckToken performs request validation and calls underlying method

func (*ServerWrapper) CreateToken

func (v *ServerWrapper) CreateToken(ctx context.Context, req *authProto.CreateTokenRequest) (*authProto.CreateTokenResponse, error)

CreateToken performs request validation and calls underlying method

func (*ServerWrapper) DeleteToken

func (v *ServerWrapper) DeleteToken(ctx context.Context, req *authProto.DeleteTokenRequest) (*empty.Empty, error)

DeleteToken performs request validation and calls underlying method

func (*ServerWrapper) DeleteUserTokens

func (v *ServerWrapper) DeleteUserTokens(ctx context.Context, req *authProto.DeleteUserTokensRequest) (*empty.Empty, error)

DeleteUserTokens performs request validation and calls underlying method

func (*ServerWrapper) ExtendToken

func (v *ServerWrapper) ExtendToken(ctx context.Context, req *authProto.ExtendTokenRequest) (*authProto.ExtendTokenResponse, error)

ExtendToken performs request validation and calls underlying method

func (*ServerWrapper) GetUserTokens

func (v *ServerWrapper) GetUserTokens(ctx context.Context, req *authProto.GetUserTokensRequest) (*authProto.GetUserTokensResponse, error)

GetUserTokens performs request validation and calls underlying method

func (*ServerWrapper) UpdateAccess

func (v *ServerWrapper) UpdateAccess(ctx context.Context, req *authProto.UpdateAccessRequest) (*empty.Empty, error)

UpdateAccess performs request validation and calls underlying method

Jump to

Keyboard shortcuts

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