app

package
v0.0.0-...-0f41e6e Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: GPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PROCESS     = "maple-file"
	VERSION     = "dev"
	DESCRIPTION = "Multi-protocol cloud file upload and management with serverless."
)

Functions

func Listen

func Listen(addr string) (net.Listener, error)

func Register

func Register(name string, creator ServiceCreator)

func Start

func Start(cfg string) (string, error)

func Stop

func Stop()

Types

type App

type App struct {
	DB     *DB
	Logger *Logger
	Config *config.Config
	Runner runner.Runner
	// contains filtered or unexported fields
}

func New

func New() *App

func (*App) Context

func (app *App) Context() context.Context

func (*App) Init

func (app *App) Init() error

func (*App) NewServer

func (app *App) NewServer() (*Server, error)

type BaseService

type BaseService struct{}

func (BaseService) Close

func (BaseService) Close() error

func (BaseService) Register

func (BaseService) Register(*grpc.Server)

func (BaseService) RegisterGateway

func (BaseService) RegisterGateway(context.Context, *runtime.ServeMux)

func (BaseService) RegisterHTTP

func (BaseService) RegisterHTTP(*echo.Echo)

type Config

type Config = config.Config

type DB

type DB struct {
	*gorm.DB
}

func NewDB

func NewDB(conf *Config) (*DB, error)

func (*DB) AutoMigrate

func (db *DB) AutoMigrate(dst ...any) (err error)

func (*DB) WithContext

func (db *DB) WithContext(ctx context.Context) *DB

type Logger

type Logger struct {
	*logrus.Logger
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(conf *Config) *Logger

func (*Logger) Close

func (log *Logger) Close() error

type Server

type Server struct {
	Mux  *runtime.ServeMux
	Echo *echo.Echo
	Grpc *grpc.Server
	// contains filtered or unexported fields
}

func NewServer

func NewServer(app *App) (*Server, error)

func (*Server) Addr

func (srv *Server) Addr() string

func (*Server) Result

func (srv *Server) Result() (string, error)

func (*Server) Shutdown

func (srv *Server) Shutdown() error

func (*Server) Start

func (srv *Server) Start() error

type Service

type Service interface {
	Register(*grpc.Server)
	RegisterHTTP(*echo.Echo)
	RegisterGateway(context.Context, *runtime.ServeMux)
	Close() error
}

type ServiceCreator

type ServiceCreator func(*App) (Service, error)

type Services

type Services []Service

func (Services) Close

func (srvs Services) Close() error

func (Services) Register

func (srvs Services) Register(grpc *grpc.Server)

func (Services) RegisterGateway

func (srvs Services) RegisterGateway(ctx context.Context, mux *runtime.ServeMux)

func (Services) RegisterHTTP

func (srvs Services) RegisterHTTP(e *echo.Echo)

type Table

type Table struct {
	Name  string
	Model any
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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