Skip to content

Reference library for the parsing and loading SCORE files

License

Notifications You must be signed in to change notification settings

astromechza/score-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

score-go

Reference library for the parsing and loading SCORE files

Parsing SCORE files

This library includes a few utility methods to parse source SCORE files.

import (
    "io"
    "os"
    
    "github.com/score-spec/score-go/loader"
    score "github.com/score-spec/score-go/types"
)

func main() {
    var (
        err error
        src io.Reader
    )

    if src, err = os.Open("score.yaml"); err != nil {
        panic(err)
    }
	defer src.Close()
    
    var srcMap map[string]interface{}
    if err = loader.ParseYAML(&srcMap, src); err != nil {
        panic(err)
    }
    
    var spec score.WorkloadSpec
    if err = loader.MapSpec(&spec, srcMap); err != nil {
        panic(err)
    }

    // Do something with the spec
    // ...
}

About

Reference library for the parsing and loading SCORE files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%