sourcevalidator

package
v0.0.0-...-834ce46 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository interface {
	Exist(id string) (bool, error)
}

type Validator

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

func New

func New(sourceRepo Repository) Validator

func (Validator) ValidateCreateRequest

func (v Validator) ValidateCreateRequest(req sourceparam.CreateRequest) *validator.Error

func (Validator) ValidateDeleteRequest

func (v Validator) ValidateDeleteRequest(req sourceparam.DeleteRequest) *validator.Error

func (Validator) ValidateDisableRequest

func (v Validator) ValidateDisableRequest(req sourceparam.DisableRequest) *validator.Error

func (Validator) ValidateEnableRequest

func (v Validator) ValidateEnableRequest(req sourceparam.EnableRequest) *validator.Error

func (Validator) ValidateRotateWriteKeyRequest

func (v Validator) ValidateRotateWriteKeyRequest(req sourceparam.RotateWriteKeyRequest) *validator.Error

func (Validator) ValidateShowRequest

func (v Validator) ValidateShowRequest(req sourceparam.ShowRequest) *validator.Error

func (Validator) ValidateUpdateRequest

func (v Validator) ValidateUpdateRequest(req sourceparam.UpdateRequest) *validator.Error

type ValidatorError

type ValidatorError struct {
	Fields map[string]string `json:"error"`
	Err    error             `json:"message"`
}

func (ValidatorError) Error

func (v ValidatorError) Error() string

Jump to

Keyboard shortcuts

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