github.com/drone/runner-go@v1.12.0/manifest/manifest.go (about)

     1  // Copyright 2019 Drone.IO Inc. All rights reserved.
     2  // Use of this source code is governed by the Polyform License
     3  // that can be found in the LICENSE file.
     4  
     5  // Package manifest provides definitions for the Yaml schema.
     6  package manifest
     7  
     8  // Resource enums.
     9  const (
    10  	KindApproval   = "approval"
    11  	KindDeployment = "deployment"
    12  	KindPipeline   = "pipeline"
    13  	KindSecret     = "secret"
    14  	KindSignature  = "signature"
    15  )
    16  
    17  type (
    18  	// Manifest is a collection of Drone resources.
    19  	Manifest struct {
    20  		Resources []Resource
    21  	}
    22  
    23  	// Resource represents a Drone resource.
    24  	Resource interface {
    25  		GetVersion() string
    26  		GetKind() string
    27  		GetType() string
    28  		GetName() string
    29  	}
    30  
    31  	// ConcurrentResource is a resource with concurrency limits.
    32  	ConcurrentResource interface {
    33  		Resource
    34  		GetConcurrency() Concurrency
    35  	}
    36  
    37  	// DependantResource is a resource with runtime dependencies.
    38  	DependantResource interface {
    39  		Resource
    40  		GetDependsOn() []string
    41  	}
    42  
    43  	// PlatformResource is a resource with platform requirements.
    44  	PlatformResource interface {
    45  		Resource
    46  		GetPlatform() Platform
    47  	}
    48  
    49  	// RoutedResource is a resource that can be routed to
    50  	// specific build nodes.
    51  	RoutedResource interface {
    52  		Resource
    53  		GetNodes() map[string]string
    54  	}
    55  
    56  	// TriggeredResource is a resource with trigger rules.
    57  	TriggeredResource interface {
    58  		Resource
    59  		GetTrigger() Conditions
    60  	}
    61  
    62  	// RawResource is a raw encoded resource with the common
    63  	// metadata extracted.
    64  	RawResource struct {
    65  		Version     string
    66  		Kind        string
    67  		Type        string
    68  		Name        string
    69  		Deps        []string `yaml:"depends_on"`
    70  		Node        map[string]string
    71  		Concurrency Concurrency
    72  		Platform    Platform
    73  		Data        []byte `yaml:"-"`
    74  	}
    75  )