paths

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(paths ...string) string

Types

type Path

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

func NewPath

func NewPath(path, main string, isModule bool) *Path

func (*Path) Abs

func (r *Path) Abs(paths ...string) string

func (*Path) Import

func (r *Path) Import() string

Import returns the sub-package import path, or the main package import path if no sub-package path is specified. For example, if r.path is "app/http/controllers" and r.main is "github.com/goravel/goravel", it returns "goravel/app/http/controllers". If r.path is empty, it returns "goravel". The path will be returned directly if it starts with "github.com/goravel/framework/", given it's a framework sub-package.

func (*Path) Package

func (r *Path) Package() string

Package returns the sub-package name, or the main package name if no sub-package path is specified. For example, if r.path is "app/http/controllers", it returns "controllers". If r.path is empty, it returns the last component of r.main.

func (*Path) String

func (r *Path) String(paths ...string) string

type Paths

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

func NewPaths

func NewPaths(mainPath string) *Paths

func (*Paths) App

func (r *Paths) App() packages.Path

func (*Paths) Bootstrap

func (r *Paths) Bootstrap() packages.Path

Bootstrap returns the bootstrap package path, eg: goravel/bootstrap.

func (*Paths) Config

func (r *Paths) Config() packages.Path

Config returns the config package path, eg: goravel/config.

func (*Paths) Database

func (r *Paths) Database() packages.Path

func (*Paths) Facades

func (r *Paths) Facades() packages.Path

Facades returns the facades package path, eg: goravel/app/facades.

func (*Paths) Lang

func (r *Paths) Lang() packages.Path

func (*Paths) Main

func (r *Paths) Main() packages.Path

Main returns the main package path, eg: github.com/goravel/goravel.

func (*Paths) Migrations

func (r *Paths) Migrations() packages.Path

func (*Paths) Models

func (r *Paths) Models() packages.Path

func (*Paths) Module

func (r *Paths) Module() packages.Path

Module returns the module path of the package, eg: github.com/goravel/framework/auth.

func (*Paths) Public

func (r *Paths) Public() packages.Path

func (*Paths) Resources

func (r *Paths) Resources() packages.Path

func (*Paths) Routes

func (r *Paths) Routes() packages.Path

Routes returns the routes package path, eg: goravel/routes.

func (*Paths) Storage

func (r *Paths) Storage() packages.Path

func (*Paths) Tests

func (r *Paths) Tests() packages.Path

Tests returns the tests package path, eg: goravel/tests.

func (*Paths) Views

func (r *Paths) Views() packages.Path

Jump to

Keyboard shortcuts

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