validate

package
v0.0.0-...-d772fc0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package validate implements utilities to validate properties and objects

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidCron

func ValidCron(value string) error

ValidCron checks if the syntax of value is valid for a cron job

Types

type JobValidator

type JobValidator struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	When        string `json:"when"`
	Active      bool   `json:"active"`
	URL         string `json:"url"`

	// Errors after validating the instance
	Errors []error
}

JobValidator implements the requirements of a validator in order to be able to create correct Jobs

func NewJobValidatorFromJSON

func NewJobValidatorFromJSON(j string) (v *JobValidator, err error)

NewJobValidatorFromJSON creates a validator from a json

func (*JobValidator) Instance

func (v *JobValidator) Instance() (j *job.Job, err error)

Instance returns a valid instance

func (*JobValidator) Validate

func (v *JobValidator) Validate() error

Validate validates the validator and creates teh correct instance

type Validator

type Validator interface {
	Validate() error
}

Validator validates properties of a validator object

Jump to

Keyboard shortcuts

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