Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.
/ go-vali Public archive

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

License

Notifications You must be signed in to change notification settings

twpayne/go-vali

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-vali

This package has moved to github.com/twpayne/go-igc/civlovs. This repo is archived.

PkgGoDev

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

Example

func ExampleClient_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.NewClient().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