forked from go-vela/types
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathitem.go
28 lines (24 loc) · 746 Bytes
/
item.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (c) 2022 Target Brands, Inc. All rights reserved.
//
// Use of this source code is governed by the LICENSE file in this repository.
package types
import (
"github.com/go-vela/types/library"
"github.com/go-vela/types/pipeline"
)
// Item is the queue representation of an item to publish to the queue.
type Item struct {
Build *library.Build `json:"build"`
Pipeline *pipeline.Build `json:"pipeline"`
Repo *library.Repo `json:"repo"`
User *library.User `json:"user"`
}
// ToItem creates a queue item from a pipeline, build, repo and user.
func ToItem(p *pipeline.Build, b *library.Build, r *library.Repo, u *library.User) *Item {
return &Item{
Pipeline: p,
Build: b,
Repo: r,
User: u,
}
}