server

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IS

type IS struct {
	v1.UnimplementedFilesInternalServiceServer
	// contains filtered or unexported fields
}

IS is an internal server.

func NewInternal

func NewInternal(store *store.S, log logr.Logger) *IS

NewInternal creates an internal server.

func (*IS) GetFilePath

func (s *IS) GetFilePath(
	ctx context.Context,
	req *v1.GetFilePathRequest,
) (*v1.GetFilePathResponse, error)

GetFilePath gets a file path.

func (*IS) Run

func (s *IS) Run(port int) error

Run starts the gRPC server.

type NoopS3Client

type NoopS3Client struct{}

NoopS3Client is a no-op S3 client.

func (*NoopS3Client) Upload

func (n *NoopS3Client) Upload(ctx context.Context, r io.Reader, key string) error

Upload is a no-op implementation of Upload.

type S

type S struct {
	v1.UnimplementedFilesServiceServer
	// contains filtered or unexported fields
}

S is a server.

func New

func New(store *store.S, s3Client S3Client, sender sender.UsageSetter, pathPrefix string, log logr.Logger) *S

New creates a server.

func (*S) CreateFile

func (s *S) CreateFile(
	w http.ResponseWriter,
	req *http.Request,
	pathParams map[string]string,
)

CreateFile creates a file.

func (*S) DeleteFile

func (s *S) DeleteFile(
	ctx context.Context,
	req *v1.DeleteFileRequest,
) (*v1.DeleteFileResponse, error)

DeleteFile deletes a file.

func (*S) GetFile

func (s *S) GetFile(
	ctx context.Context,
	req *v1.GetFileRequest,
) (*v1.File, error)

GetFile gets a file.

func (*S) GetFileContent

func (s *S) GetFileContent(
	w http.ResponseWriter,
	req *http.Request,
	pathParams map[string]string,
)

GetFileContent gets a file content.

func (*S) ListFiles

func (s *S) ListFiles(
	ctx context.Context,
	req *v1.ListFilesRequest,
) (*v1.ListFilesResponse, error)

ListFiles lists files.

func (*S) Run

func (s *S) Run(ctx context.Context, port int, authConfig config.AuthConfig) error

Run starts the gRPC server.

func (*S) Stop

func (s *S) Stop()

Stop stops the gRPC server.

type S3Client

type S3Client interface {
	Upload(ctx context.Context, r io.Reader, key string) error
}

S3Client is an interface for an S3 client.

type WS

type WS struct {
	v1.UnimplementedFilesWorkerServiceServer
	// contains filtered or unexported fields
}

WS is a server for worker services.

func NewWorkerServiceServer

func NewWorkerServiceServer(s *store.S, log logr.Logger) *WS

NewWorkerServiceServer creates a new worker service server.

func (*WS) GetFilePath

func (s *WS) GetFilePath(
	ctx context.Context,
	req *v1.GetFilePathRequest,
) (*v1.GetFilePathResponse, error)

GetFilePath gets a file path.

func (*WS) Run

func (ws *WS) Run(ctx context.Context, port int, authConfig config.AuthConfig) error

Run runs the worker service server.

func (*WS) Stop

func (ws *WS) Stop()

Stop stops the worker service server.

Jump to

Keyboard shortcuts

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