Documentation
¶
Index ¶
- Constants
- Variables
- func DetectContentType(filename string, content []byte) string
- func GetBlobPath(appDir string, bucketName string, blobName string) (string, error)
- func GetBucketPath(appDir string, bucketName string) (string, error)
- func GetServiceLogPath(appDir string, serviceName string) (string, error)
- type PrefixWriter
- type SimulationServer
- func (s *SimulationServer) CopyDir(dst, src string) error
- func (s *SimulationServer) Delete(ctx context.Context, req *storagepb.StorageDeleteRequest) (*storagepb.StorageDeleteResponse, error)
- func (s *SimulationServer) Exists(ctx context.Context, req *storagepb.StorageExistsRequest) (*storagepb.StorageExistsResponse, error)
- func (s *SimulationServer) ListBlobs(ctx context.Context, req *storagepb.StorageListBlobsRequest) (*storagepb.StorageListBlobsResponse, error)
- func (s *SimulationServer) PreSignUrl(ctx context.Context, req *storagepb.StoragePreSignUrlRequest) (*storagepb.StoragePreSignUrlResponse, error)
- func (s *SimulationServer) Read(ctx context.Context, req *storagepb.StorageReadRequest) (*storagepb.StorageReadResponse, error)
- func (s *SimulationServer) Start(output io.Writer) error
- func (s *SimulationServer) Stop() error
- func (s *SimulationServer) Write(ctx context.Context, req *storagepb.StorageWriteRequest) (*storagepb.StorageWriteResponse, error)
- type SimulationServerOption
Constants ¶
View Source
const ( SUGA_SERVICE_MIN_PORT = 50051 SUGA_SERVICE_MAX_PORT = 50999 ENTRYPOINT_MIN_PORT = 3000 ENTRYPOINT_MAX_PORT = 3999 )
View Source
const ( BUCKET_MIN_PORT = 5000 BUCKET_MAX_PORT = 5999 )
Variables ¶
View Source
var ( DotSugaDir = "./" + version.ConfigDirName // Container of all buckets BucketsDir = filepath.Join(DotSugaDir, "buckets") // Container of all services ServicesDir = filepath.Join(DotSugaDir, "services") // Container of all service logs ServicesLogsDir = filepath.Join(ServicesDir, "logs") )
Functions ¶
func DetectContentType ¶
func GetBlobPath ¶
Get the path to the blob file for a specific bucket
func GetBucketPath ¶
Get the path to the bucket directory for a specific bucket
Types ¶
type PrefixWriter ¶
type PrefixWriter struct {
// contains filtered or unexported fields
}
func NewPrefixWriter ¶
func NewPrefixWriter(prefix string, writer io.Writer) *PrefixWriter
type SimulationServer ¶
type SimulationServer struct {
storagepb.UnimplementedStorageServer
pubsubpb.UnimplementedPubsubServer
// contains filtered or unexported fields
}
func NewSimulationServer ¶
func NewSimulationServer(fs afero.Fs, appSpec *schema.Application, opts ...SimulationServerOption) *SimulationServer
func (*SimulationServer) CopyDir ¶
func (s *SimulationServer) CopyDir(dst, src string) error
CopyDir copies the content of src to dst. src should be a full path.
func (*SimulationServer) Delete ¶
func (s *SimulationServer) Delete(ctx context.Context, req *storagepb.StorageDeleteRequest) (*storagepb.StorageDeleteResponse, error)
func (*SimulationServer) Exists ¶
func (s *SimulationServer) Exists(ctx context.Context, req *storagepb.StorageExistsRequest) (*storagepb.StorageExistsResponse, error)
func (*SimulationServer) ListBlobs ¶
func (s *SimulationServer) ListBlobs(ctx context.Context, req *storagepb.StorageListBlobsRequest) (*storagepb.StorageListBlobsResponse, error)
func (*SimulationServer) PreSignUrl ¶
func (s *SimulationServer) PreSignUrl(ctx context.Context, req *storagepb.StoragePreSignUrlRequest) (*storagepb.StoragePreSignUrlResponse, error)
func (*SimulationServer) Read ¶
func (s *SimulationServer) Read(ctx context.Context, req *storagepb.StorageReadRequest) (*storagepb.StorageReadResponse, error)
func (*SimulationServer) Stop ¶
func (s *SimulationServer) Stop() error
Stop gracefully shuts down the simulation server and cleans up resources
func (*SimulationServer) Write ¶
func (s *SimulationServer) Write(ctx context.Context, req *storagepb.StorageWriteRequest) (*storagepb.StorageWriteResponse, error)
type SimulationServerOption ¶
type SimulationServerOption func(*SimulationServer)
func WithAppDirectory ¶
func WithAppDirectory(appDir string) SimulationServerOption
Click to show internal directories.
Click to hide internal directories.