github.com/release-engineering/exodus-rsync@v1.11.2/internal/gw/dryrun.go (about) 1 package gw 2 3 import ( 4 "context" 5 6 "github.com/release-engineering/exodus-rsync/internal/conf" 7 ) 8 9 type dryRunPublish struct{} 10 11 func (i impl) NewDryRunClient(ctx context.Context, cfg conf.Config) (Client, error) { 12 clientIface, err := i.NewClient(ctx, cfg) 13 if err != nil { 14 return nil, err 15 } 16 17 clientIface.(*client).dryRun = true 18 return clientIface, err 19 } 20 21 func (*dryRunPublish) ID() string { 22 return "abcd1234" 23 } 24 25 func (*dryRunPublish) AddItems(ctx context.Context, _ []ItemInput) error { 26 return ctx.Err() 27 } 28 29 func (*dryRunPublish) Commit(ctx context.Context, _ string) error { 30 return ctx.Err() 31 }