Skip to content

twpayne/go-vali

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-vali

PkgGoDev

Package vali provides a client interface to CIVL's Open Validation Server.

Example

func ExampleNew_ValidateIGC() {
    filename := "testdata/2006-06-10-XXX-3XI-01.IGC"
    igcFile, err := os.Open(filename)
    if err != nil {
        fmt.Println(err)
        return
    }
    defer igcFile.Close()
    ctx := context.Background()
    if status, _, err := vali.New().ValidateIGC(ctx, filename, igcFile); status == vali.Valid {
        fmt.Println("OK")
    } else {
        fmt.Println(err)
    }
    // Output: OK
}

A simple command line client is included. Install and run it with:

$ go install github.com/twpayne/go-vali/cmd/vali@latest
$ vali filename.igc
filename.igc: Valid
$ echo $?
0

The exit code is 0 if the IGC file is valid, 1 if it is invalid, or 2 if it could not be validated.

License

MIT

About

Package go-vali implements an API to the FAI's Open Validation Service.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages