github.com/drone/runner-go@v1.12.0/pipeline/reporter.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 pipeline 6 7 import "context" 8 9 // A Reporter reports the pipeline status. 10 type Reporter interface { 11 // ReportStage reports the stage status. 12 ReportStage(context.Context, *State) error 13 14 // ReportStep reports the named step status. 15 ReportStep(context.Context, *State, string) error 16 } 17 18 // NopReporter returns a noop reporter. 19 func NopReporter() Reporter { 20 return new(nopReporter) 21 } 22 23 type nopReporter struct{} 24 25 func (*nopReporter) ReportStage(context.Context, *State) error { return nil } 26 func (*nopReporter) ReportStep(context.Context, *State, string) error { return nil }