github.com/chenbh/concourse/v6@v6.4.2/atc/runtime/types.go (about)

     1  package runtime
     2  
     3  import (
     4  	"context"
     5  	"fmt"
     6  	"io"
     7  
     8  	"code.cloudfoundry.org/lager"
     9  	"github.com/chenbh/concourse/v6/atc"
    10  )
    11  
    12  const (
    13  	ResourceResultPropertyName = "concourse:resource-result"
    14  	ResourceProcessID          = "resource"
    15  )
    16  
    17  //go:generate counterfeiter . StartingEventDelegate
    18  type StartingEventDelegate interface {
    19  	Starting(lager.Logger)
    20  	SelectedWorker(lager.Logger, string)
    21  }
    22  
    23  type VersionResult struct {
    24  	Version  atc.Version         `json:"version"`
    25  	Metadata []atc.MetadataField `json:"metadata,omitempty"`
    26  }
    27  
    28  type PutRequest struct {
    29  	Source atc.Source `json:"source"`
    30  	Params atc.Params `json:"params,omitempty"`
    31  }
    32  
    33  type GetRequest struct {
    34  	Source atc.Source `json:"source"`
    35  	Params atc.Params `json:"params,omitempty"`
    36  }
    37  
    38  //go:generate counterfeiter . Artifact
    39  type Artifact interface {
    40  	ID() string
    41  }
    42  
    43  type CacheArtifact struct {
    44  	TeamID   int
    45  	JobID    int
    46  	StepName string
    47  	Path     string
    48  }
    49  
    50  func (art CacheArtifact) ID() string {
    51  	return fmt.Sprintf("%d, %d, %s, %s", art.TeamID, art.JobID, art.StepName, art.Path)
    52  }
    53  
    54  // TODO (Krishna/Sameer): get rid of these - can GetArtifact and TaskArtifact be merged ?
    55  type GetArtifact struct {
    56  	VolumeHandle string
    57  }
    58  
    59  func (art GetArtifact) ID() string {
    60  	return art.VolumeHandle
    61  }
    62  
    63  type TaskArtifact struct {
    64  	VolumeHandle string
    65  }
    66  
    67  func (art TaskArtifact) ID() string {
    68  	return art.VolumeHandle
    69  }
    70  
    71  // TODO (runtime/#4910): consider a different name as this is close to "Runnable" in atc/engine/engine
    72  //go:generate counterfeiter . Runner
    73  type Runner interface {
    74  	RunScript(
    75  		ctx context.Context,
    76  		path string,
    77  		args []string,
    78  		input []byte,
    79  		output interface{},
    80  		logDest io.Writer,
    81  		recoverable bool,
    82  	) error
    83  }
    84  
    85  type ProcessSpec struct {
    86  	Path         string
    87  	Args         []string
    88  	Dir          string
    89  	User         string
    90  	StdoutWriter io.Writer
    91  	StderrWriter io.Writer
    92  }