github.com/nya3jp/tast@v0.0.0-20230601000426-85c8e4d83a9b/src/go.chromium.org/tast/core/internal/devserver/client.go (about) 1 // Copyright 2018 The ChromiumOS Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Package devserver provides a client for devservers. For more information about 6 // devservers, see go/devserver-doc. 7 package devserver 8 9 import ( 10 "context" 11 "io" 12 "net/url" 13 ) 14 15 // Client is a client interface to communicate with devservers. 16 type Client interface { 17 // Open opens a file on Google Cloud Storage at gsURL. gsURL must have a "gs://" scheme. 18 // Callers are responsible to close the/ returned io.ReadCloser after use. 19 // If the file does not exist, os.ErrNotExist is returned. 20 Open(ctx context.Context, gsURL string) (io.ReadCloser, error) 21 22 // Stage opens a file on Google Cloud Storage at gsURL. sURL must have a "gs://" scheme. 23 // Returns a http or file url to the data. 24 Stage(ctx context.Context, gsURL string) (*url.URL, error) 25 26 // TearDown should be called once when the Client is destructed, 27 // regardless of whether Open was called or not. 28 TearDown() error 29 }