athens

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 17, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdmissionHandler

func AdmissionHandler(validator Validator, forbiddenSources ...string) http.HandlerFunc

AdmissionHandler is a athens admission (validator) web hook handler It calls internal validator to check if module can be used.

Types

type ErrForbidden

type ErrForbidden struct {
	Inner error
}

ErrForbidden should be returned by Validator if module validation failed by rule set

func (*ErrForbidden) Error

func (e *ErrForbidden) Error() string

func (*ErrForbidden) Unwrap

func (e *ErrForbidden) Unwrap() error

type InternalValidator

type InternalValidator struct {
	validation.Validator
}

func (*InternalValidator) Validate

type ValidationRequest

type ValidationRequest struct {
	Module  string
	Version *semver.Version
}

type Validator

type Validator interface {
	Validate(ctx context.Context, req ValidationRequest) error
}

type ValidatorMock

type ValidatorMock struct {
	mock.Mock
}

func (*ValidatorMock) Validate

func (m *ValidatorMock) Validate(ctx context.Context, req ValidationRequest) error

Jump to

Keyboard shortcuts

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