sevki.org/build/builder

Package builder parses build graphs and coordinates builds

Index

Package Files

builder.go coordinator.go pque.go

Constants

const (
    SCSSLOG = "success"
    FAILLOG = "fail"
    TMP     = "/tmp"
)

type Builder

type Builder struct {
    Origin      string
    Wd          string
    ProjectPath string
    Nodes       map[string]*Node
    Total       int
    Done        chan *Node
    Error       chan error
    Timeout     chan bool
    Updates     chan *Node
    Root        *Node
    // contains filtered or unexported fields
}

func New

func New() (c Builder)

func (*Builder) Add

func (b *Builder) Add(t string) *Node

func (*Builder) Execute

func (b *Builder) Execute(d time.Duration, r int)

type ByName

type ByName []*Node

func (ByName) Len

func (a ByName) Len() int

func (ByName) Less

func (a ByName) Less(i, j int) bool

func (ByName) Swap

func (a ByName) Swap(i, j int)

type Node

type Node struct {
    IsRoot   bool         `json:"-"`
    Target   build.Target `json:"-"`
    Type     string
    Parents  map[string]*Node `json:"-"`
    Url      parser.TargetURL
    Worker   string
    Priority int

    Status     STATUS
    Cached     bool
    Start, End int64
    Hash       string
    Output     string `json:"-"`

    sync.Mutex
    Children map[string]*Node
    // contains filtered or unexported fields
}

func (*Node) HashNode

func (n *Node) HashNode() []byte

type PriorityQueue

type PriorityQueue []*Node

func (PriorityQueue) Len

func (pq PriorityQueue) Len() int

func (PriorityQueue) Less

func (pq PriorityQueue) Less(i, j int) bool

func (*PriorityQueue) Pop

func (pq *PriorityQueue) Pop() interface{}

func (*PriorityQueue) Push

func (pq *PriorityQueue) Push(x interface{})

func (PriorityQueue) Swap

func (pq PriorityQueue) Swap(i, j int)

type STATUS

type STATUS int
const (
    Success STATUS = iota
    Fail
    Pending
    Started
    Fatal
    Warning
    Building
)

type Update

type Update struct {
    TimeStamp time.Time
    Target    string
    Status    STATUS
    Worker    int
    Cached    bool
}

Subdirectories