validator

package module
v0.0.0-...-30d9255 Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: Apache-2.0 Imports: 8 Imported by: 1

README

Go Report Card Build Status codecov

JSON Resume Validator

Go library to validate your JSON Resume according to defined schema

For more information on JSON resumes, please visit official JSON Resume

Installation

$ go get github.com/cinarmert/json-resume-validator

Sample Application

Sample Usage


// Initialize with a file
rv := new(resumeValidator.ResumeValidator).WithFile("path/to/file")

// Initialize with data
rv := new(resumeValidator.ResumeValidator).WithData([]bytes("{}"))

// Validate and process errors
err := rv.Validate()

// Check if it is valid 
rv.IsValid()

More samples can be found in tests.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resume

type Resume struct {
	Basics       basics        `json:"basics"`
	Work         []work        `json:"work"`
	Volunteer    []volunteer   `json:"volunteer"`
	Education    []education   `json:"education"`
	Awards       []award       `json:"awards"`
	Publications []publication `json:"publications"`
	Skills       []skill       `json:"skills"`
	Languages    []language    `json:"languages"`
	Interests    []interest    `json:"interests"`
	References   []reference   `json:"references"`
}

Resume holds the information according to schema described in https://jsonresume.org/schema/

type ResumeValidator

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

ResumeValidator contains the data, validator and populates resume on validation

func (*ResumeValidator) IsValid

func (rv *ResumeValidator) IsValid() bool

IsValid return only a boolean indicating if the provided resume is valid

func (*ResumeValidator) Validate

func (rv *ResumeValidator) Validate() error

Validate attempts to validate json resume either from file or data you provided using WithData/WithFile

func (*ResumeValidator) WithData

func (rv *ResumeValidator) WithData(data []byte) *ResumeValidator

WithData sets the bytes that will be validated

func (*ResumeValidator) WithFile

func (rv *ResumeValidator) WithFile(filepath string) *ResumeValidator

WithFile sets the filepath that will be validated

Jump to

Keyboard shortcuts

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