simulation

package
v0.0.0-...-d9d2748 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2025 License: MPL-2.0 Imports: 35 Imported by: 0

Documentation

Index

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 DetectContentType(filename string, content []byte) string

func GetBlobPath

func GetBlobPath(appDir string, bucketName string, blobName string) (string, error)

Get the path to the blob file for a specific bucket

func GetBucketPath

func GetBucketPath(appDir string, bucketName string) (string, error)

Get the path to the bucket directory for a specific bucket

func GetServiceLogPath

func GetServiceLogPath(appDir string, serviceName string) (string, error)

Get the path to the log file for a specific service

Types

type PrefixWriter

type PrefixWriter struct {
	// contains filtered or unexported fields
}

func NewPrefixWriter

func NewPrefixWriter(prefix string, writer io.Writer) *PrefixWriter

func (*PrefixWriter) Write

func (p *PrefixWriter) Write(content []byte) (int, error)

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 (*SimulationServer) Exists

func (*SimulationServer) Read

func (*SimulationServer) Start

func (s *SimulationServer) Start(output io.Writer) error

func (*SimulationServer) Stop

func (s *SimulationServer) Stop() error

Stop gracefully shuts down the simulation server and cleans up resources

func (*SimulationServer) Write

type SimulationServerOption

type SimulationServerOption func(*SimulationServer)

func WithAppDirectory

func WithAppDirectory(appDir string) SimulationServerOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL