Documentation
¶
Overview ¶
GitHub Actions Artifacts v4 protocol messages — plain Go structs, no protobuf.
This replaces the generated artifact.pb.go. That file registered a protobuf FileDescriptor at package init from an embedded rawDesc; a version skew between the generator and the linked google.golang.org/protobuf runtime made the descriptor unparseable and the binary panicked at startup ("slice bounds out of range" in unmarshalSeed) before it could serve anything. The Actions artifact wire format is already JSON (the handler used protojson, Content-Type application/json), so protobuf bought nothing here but a fragile init.
These structs serialize with encoding/json to the SAME proto3-JSON bytes the act_runner exchanges: lowerCamelCase field names, int64 as a JSON string, a Timestamp as an RFC 3339 string, and the well-known wrappers (StringValue, Int64Value) as their bare primitive. artifact_wire_test.go locks that byte contract with golden vectors so the runner protocol cannot silently drift.
Index ¶
- Constants
- func ArtifactContexter() func(next http.Handler) http.Handler
- func ArtifactV4Contexter() func(next http.Handler) http.Handler
- func ArtifactsRoutes(prefix string) *web.Router
- func ArtifactsV4Routes(prefix string) *web.Router
- func Routes(prefix string) *web.Router
- type ArtifactContext
- type BlockList
- type CreateArtifactRequest
- type CreateArtifactResponse
- type DeleteArtifactRequest
- type DeleteArtifactResponse
- type FinalizeArtifactRequest
- type FinalizeArtifactResponse
- type GetSignedArtifactURLRequest
- type GetSignedArtifactURLResponse
- type Int64Value
- type Latest
- type ListArtifactsRequest
- type ListArtifactsResponse
- type ListArtifactsResponse_MonolithArtifact
- type StringValue
- type Timestamp
Constants ¶
const ArtifactV4RouteBase = "/twirp/github.actions.results.api.v1.ArtifactService"
Variables ¶
This section is empty.
Functions ¶
func ArtifactsRoutes ¶
func ArtifactsV4Routes ¶
Types ¶
type ArtifactContext ¶
type ArtifactContext struct {
*context.Base
ActionTask *actions.ActionTask
}
type CreateArtifactRequest ¶
type CreateArtifactRequest struct {
WorkflowRunBackendId string `json:"workflowRunBackendId,omitempty"`
WorkflowJobRunBackendId string `json:"workflowJobRunBackendId,omitempty"`
Name string `json:"name,omitempty"`
ExpiresAt *Timestamp `json:"expiresAt,omitempty"`
Version int32 `json:"version,omitempty"`
MimeType *StringValue `json:"mimeType,omitempty"`
}
func (*CreateArtifactRequest) GetMimeType ¶
func (x *CreateArtifactRequest) GetMimeType() *StringValue
type CreateArtifactResponse ¶
type DeleteArtifactRequest ¶
type DeleteArtifactResponse ¶
type FinalizeArtifactRequest ¶
type FinalizeArtifactRequest struct {
WorkflowRunBackendId string `json:"workflowRunBackendId,omitempty"`
WorkflowJobRunBackendId string `json:"workflowJobRunBackendId,omitempty"`
Name string `json:"name,omitempty"`
Size int64 `json:"size,string,omitempty"`
Hash *StringValue `json:"hash,omitempty"`
}
func (*FinalizeArtifactRequest) GetHash ¶
func (x *FinalizeArtifactRequest) GetHash() *StringValue
type GetSignedArtifactURLResponse ¶
type GetSignedArtifactURLResponse struct {
SignedUrl string `json:"signedUrl,omitempty"`
}
type Int64Value ¶ added in v1.26.7
type Int64Value struct{ Value int64 }
Int64Value mirrors google.protobuf.Int64Value: a nullable int64 encoded (per proto3-JSON) as a JSON string. Unmarshal also tolerates a bare JSON number.
func (*Int64Value) GetValue ¶ added in v1.26.7
func (v *Int64Value) GetValue() int64
func (Int64Value) MarshalJSON ¶ added in v1.26.7
func (v Int64Value) MarshalJSON() ([]byte, error)
func (*Int64Value) UnmarshalJSON ¶ added in v1.26.7
func (v *Int64Value) UnmarshalJSON(b []byte) error
type ListArtifactsRequest ¶
type ListArtifactsRequest struct {
WorkflowRunBackendId string `json:"workflowRunBackendId,omitempty"`
WorkflowJobRunBackendId string `json:"workflowJobRunBackendId,omitempty"`
NameFilter *StringValue `json:"nameFilter,omitempty"`
IdFilter *Int64Value `json:"idFilter,omitempty"`
}
type ListArtifactsResponse ¶
type ListArtifactsResponse struct {
Artifacts []*ListArtifactsResponse_MonolithArtifact `json:"artifacts,omitempty"`
}
type ListArtifactsResponse_MonolithArtifact ¶
type ListArtifactsResponse_MonolithArtifact struct {
WorkflowRunBackendId string `json:"workflowRunBackendId,omitempty"`
WorkflowJobRunBackendId string `json:"workflowJobRunBackendId,omitempty"`
DatabaseId int64 `json:"databaseId,string,omitempty"`
Name string `json:"name,omitempty"`
Size int64 `json:"size,string,omitempty"`
CreatedAt *Timestamp `json:"createdAt,omitempty"`
}
type StringValue ¶ added in v1.26.7
type StringValue struct{ Value string }
StringValue mirrors google.protobuf.StringValue: a nullable string encoded as a bare JSON string. GetValue is nil-safe (the generated getter's contract).
func (*StringValue) GetValue ¶ added in v1.26.7
func (s *StringValue) GetValue() string
func (StringValue) MarshalJSON ¶ added in v1.26.7
func (s StringValue) MarshalJSON() ([]byte, error)
func (*StringValue) UnmarshalJSON ¶ added in v1.26.7
func (s *StringValue) UnmarshalJSON(b []byte) error
type Timestamp ¶ added in v1.26.7
Timestamp mirrors google.protobuf.Timestamp's proto3-JSON encoding: an RFC 3339 string. It keeps the AsTime()/New() surface the handler used.
func (*Timestamp) AsTime ¶ added in v1.26.7
AsTime returns the wrapped time (zero value for a nil receiver).