go_support

Go support

SparrowCI allows to write tasks on Go. The API is similar to all other languages, but because of Go specific (naming of public functions, etc) has some nuances.

Here is some example:

tasks:
  - 
    name: my_task
    default: true
    language: Go
    code: |
      package main

      import (
        "fmt"
        "github.com/melezhik/sparrowgo"
      )

      func main() {

        // sparrowgo.DebugOn()

        type State struct { Message string }

        var state State

        sparrowgo.GetState(&state)

        fmt.Printf("task state: %s\n",state.Message)

      }
    init: |    
      package main

      import (
        "github.com/melezhik/sparrowgo"
      )

      func main() {

        type Params struct {
          Message string
        }

        sparrowgo.RunTask("foo",Params{Message: "Hello from main"})

      }
    subtasks:
      -
        name: foo
        language: Go
        code: |
          package main

          import (
            "fmt"
            "github.com/melezhik/sparrowgo"
          )

          func main() {

            // sparrowgo.DebugOn()

            type Vars struct {
              Message string
            }

            type Message struct {
              Message string
            }

            var task_vars Vars

            sparrowgo.TaskVars(&task_vars)

            fmt.Printf("foo subtask get this: %s\n",task_vars.Message)

            sparrowgo.UpdateState(Message{Message: "Hello from subtask"})
          }              

For more information visit sparrowgo project documentation page.

SparrowCI - super fun and flexible CI system with many programming languages support v0.0.2

SparrowCI

Authors

  • Alexey Melezhik

License

Artistic-2.0

Dependencies

YAMLishDBIishJSON::FastFile::Directory::TreeDigest::SHA1::Native:ver<0.05>+Cro::HTTP:ver<0.8.9>+Cro::WebApp:ver<0.8.9>+Text::Markdown:ver<1.1.1+>JSON::Fast:ver<0.17>File::Directory::Tree:ver<2022-04.14+>

Test Dependencies

Provides

  • SparrowCI
  • SparrowCI::Conf
  • SparrowCI::DB
  • SparrowCI::HTML
  • SparrowCI::News
  • SparrowCI::Repo
  • SparrowCI::Security
  • SparrowCI::User

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.