Go - job()

Creates a new Batch Job.

import (
	"github.com/nitrictech/go-sdk/nitric"
)

func main() {
	analyze := nitric.NewJob("analyze")

	nitric.Run()
}

Parameters

  • Name
    name
    Required
    Required
    Type
    string
    Description

    The unique name of this Batch Job within the app. Subsequent calls to job with the same name will return the same object.

Examples

Create a Job

import (
	"github.com/nitrictech/go-sdk/nitric"
)

func main() {
	analyze := nitric.NewJob("analyze")

	nitric.Run()
}

Create a Job with permissions to submit jobs

package main

import (
	"github.com/nitrictech/go-sdk/nitric"
	"github.com/nitrictech/go-sdk/nitric/batch"
)

func main() {
	analyse := nitric.NewJob("analyse").Allow(batch.JobSubmit)

	nitric.Run()
}