-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91fae59
commit 35188e6
Showing
45 changed files
with
1,789 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# If you prefer the allow list template instead of the deny list, see community template: | ||
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore | ||
# | ||
# Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# Dependency directories (remove the comment below to include it) | ||
# vendor/ | ||
|
||
# Go workspace file | ||
go.work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Rezwan Ahmed Sami | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# go-fiber-routemamba-application | ||
This is test project of go-fiber application with routemamba js using SEO test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/gofiber/fiber/v2" | ||
"github.com/gofiber/template/html" | ||
"github.com/rezwanahmodsami/go-fiber-routemamba-application/routers" | ||
) | ||
|
||
func main() { | ||
engine := html.New("./views", ".html") | ||
app := fiber.New(fiber.Config{ | ||
Views: engine, | ||
}) | ||
app.Static("/static", "./public") | ||
|
||
// Use the capitalized function name | ||
routers.RegisterRoutes(app) | ||
|
||
app.Listen(":3002") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module github.com/rezwanahmodsami/go-fiber-routemamba-application | ||
|
||
go 1.20 | ||
|
||
require ( | ||
github.com/andybalholm/brotli v1.0.5 // indirect | ||
github.com/gofiber/fiber/v2 v2.46.0 // indirect | ||
github.com/gofiber/template v1.8.1 // indirect | ||
github.com/google/uuid v1.3.0 // indirect | ||
github.com/klauspost/compress v1.16.3 // indirect | ||
github.com/mattn/go-colorable v0.1.13 // indirect | ||
github.com/mattn/go-isatty v0.0.18 // indirect | ||
github.com/mattn/go-runewidth v0.0.14 // indirect | ||
github.com/philhofer/fwd v1.1.2 // indirect | ||
github.com/rivo/uniseg v0.2.0 // indirect | ||
github.com/savsgio/dictpool v0.0.0-20221023140959-7bf2e61cea94 // indirect | ||
github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee // indirect | ||
github.com/tinylib/msgp v1.1.8 // indirect | ||
github.com/valyala/bytebufferpool v1.0.0 // indirect | ||
github.com/valyala/fasthttp v1.47.0 // indirect | ||
github.com/valyala/tcplisten v1.0.0 // indirect | ||
golang.org/x/sys v0.8.0 // indirect | ||
) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// set server host | ||
routemamba.registerServerHost("http://localhost:3002/"); | ||
// set meta content | ||
routemamba.registerMetaUrl("/components/meta"); | ||
|
||
routemamba.register_http_routes([ | ||
{ | ||
method: "GET", | ||
meta_loader: true, | ||
content_url: "/components/home", | ||
data: {}, | ||
preloader: "loading...", | ||
error_content: "error", | ||
http_url_change: false, | ||
http_url: "/", | ||
}, | ||
{ | ||
method: "GET", | ||
meta_loader: true, | ||
content_url: "/components/features", | ||
data: {}, | ||
preloader: "loading...", | ||
error_content: "error", | ||
http_url_change: false, | ||
http_url: "/features", | ||
}, | ||
{ | ||
method: "GET", | ||
meta_loader: true, | ||
content_url: "/components/pricing", | ||
data: {}, | ||
preloader: "loading...", | ||
error_content: "error", | ||
http_url_change: false, | ||
http_url: "/pricing", | ||
}, | ||
{ | ||
method: "GET", | ||
meta_loader: true, | ||
content_url: "/components/post", | ||
data: {}, | ||
preloader: "loading...", | ||
error_content: "error", | ||
http_url_change: false, | ||
http_url: "/post/:date/:title", | ||
}, | ||
|
||
]); | ||
|
||
// Set pages headers | ||
routemamba.register_routes_headers([ | ||
{ | ||
content_url: "/components/header", | ||
|
||
preloader: "loading...", | ||
error_content: "error", | ||
http_url: ["/", "/features", "/pricing", "/post/:date/:title"], | ||
}, | ||
]); | ||
|
||
routemamba.register_routes_footers([ | ||
{ | ||
content_url: "/components/footer", | ||
|
||
preloader: "loading...", | ||
error_content: "error", | ||
http_url: ["/", "/features", "/pricing", "/post/:date/:title"], | ||
}, | ||
]); | ||
|
||
routemamba.render(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { type RouteComponentType } from './types'; | ||
export declare const PageRenderController: () => void; | ||
export declare const store_content: (component_type: RouteComponentType, content: string) => void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { type RouteContainer, type RouteDomContent } from './types'; | ||
export declare const loadScript: (container: RouteContainer) => void; | ||
/** | ||
* This @function is for render dom content direct in body | ||
*/ | ||
export declare const __render_DOM_root: (content: RouteDomContent) => boolean; | ||
/** | ||
* @function is for render DOM in specific container >> | ||
*/ | ||
export declare const __render_DOM: (container: RouteContainer, content: RouteDomContent) => boolean; | ||
export declare const __render_state_value: (container: RouteContainer, content: RouteDomContent) => boolean; | ||
/** | ||
* @function for render dom head tag | ||
*/ | ||
export declare const __render_DOM_head: (content: RouteDomContent) => boolean; | ||
export declare const generate_body_root_element: () => void; | ||
export declare const generate_header_root_element: () => void; | ||
export declare const generate_footer_root_element: () => void; | ||
export declare const generate_required_all_root_elements: () => void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { type RegisterdRoutesFooters, type RegisterdRoutesHeaders, type RegisterdRoutesPages, type RouteErrorHead, type RouteMetaUrl, type RouteServerHost } from './types'; | ||
/** | ||
* there all golbal array, object and variable initialized | ||
*/ | ||
export declare enum RouteComponentTypes { | ||
HEADER = 0, | ||
META = 1, | ||
BODY = 2, | ||
FOOTER = 3, | ||
TAB = 4 | ||
} | ||
export declare namespace HtmlSelector { | ||
var Root: string; | ||
var Header: string; | ||
var Footer: string; | ||
var Body: string; | ||
} | ||
export declare namespace RoutesStorage { | ||
var RoutesPages: RegisterdRoutesPages; | ||
var RoutesHeaders: RegisterdRoutesHeaders<string[]>; | ||
var RoutesFooters: RegisterdRoutesFooters<string[]>; | ||
var server_host: RouteServerHost; | ||
var meta_content_url: RouteMetaUrl; | ||
namespace RouteContentsState { | ||
namespace renderStatus { | ||
var header: boolean; | ||
var body: boolean; | ||
var footer: boolean; | ||
} | ||
var ShouldHeaderload: boolean; | ||
var ShouldFooterload: boolean; | ||
var HeaderContent: string | null; | ||
var FooterContent: string | null; | ||
var BodyContent: string | null; | ||
var MetaContent: string | null; | ||
var HttpUrl: string | null; | ||
var navigationCallback: Function | null; | ||
} | ||
} | ||
export declare namespace RenderConfig { | ||
var await_rendering: boolean; | ||
} | ||
/** | ||
* this is persist storage to store readonly value. | ||
*/ | ||
export declare namespace PersistStorage { | ||
interface persistNetworkConfig { | ||
readonly localhost: string; | ||
readonly localIp: string; | ||
readonly localFilePath: string; | ||
readonly tauriHost: string; | ||
readonly http_www: string; | ||
readonly https_www: string; | ||
} | ||
interface persistantDomContent { | ||
readonly ErrorHeadContent: RouteErrorHead; | ||
readonly DefineMetaUrlError: string; | ||
readonly NavigateRoutePathUndefined: string; | ||
readonly __404_urlErrorContent: string; | ||
readonly __404_ServerHostErrorContent: string; | ||
} | ||
export var NetworkConfig: persistNetworkConfig; | ||
export var DomContent: persistantDomContent; | ||
export {}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { type NavigateRoute, type NavigateData, type NavigateOptions } from './types'; | ||
export declare const navigate: (route_to: NavigateRoute, data?: NavigateData, options?: NavigateOptions, callback?: Function | null) => void; | ||
export declare const pop_route: () => void; | ||
export declare const push_route: () => void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { type RouteHttpUrl } from './types'; | ||
export declare const MetaLoader: (httpUrl: RouteHttpUrl, RegisteredUrlPattern: RouteHttpUrl | undefined) => void; | ||
export declare const historyRoutesLoader: (status: boolean) => void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { type RegisterdRoutesPages, type RegisterdRoutesHeaders, type RegisterdRoutesFooters, type RouteServerHost, type RouteMetaUrl } from './types'; | ||
export declare const register_http_routes: (Routes: RegisterdRoutesPages) => void; | ||
export declare const register_routes_headers: (Headers: RegisterdRoutesHeaders<string[]>) => void; | ||
export declare const register_routes_footers: (Footers: RegisterdRoutesFooters<string[]>) => void; | ||
export declare const registerServerHost: (ServerHost: RouteServerHost) => void; | ||
export declare const registerMetaUrl: (MetaUrl: RouteMetaUrl) => void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* @functions | ||
*/ | ||
export declare const renderHeader: () => void; | ||
export declare const renderBody: () => void; | ||
export declare const renderFooter: () => void; | ||
export declare const render: () => void; | ||
export declare const await_rendering: (status: boolean) => void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* @namespace localState is to handles all local states. | ||
*/ | ||
export declare namespace localState { | ||
/** | ||
* @useState is to handle locally reactive and non-reactive state. | ||
* useState(@param defaultValue, @param selector); | ||
* @param selector should be className | idName | null. | ||
* @param defaultValue can be anything. | ||
* when @param selector is not null, state is reactive at that time, it's mean on state change, value will update automatic. | ||
*/ | ||
const useState: (defaultValue?: any, selectors?: string | string[] | null) => any[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { type TabRegister } from './types'; | ||
/** | ||
* | ||
* @param RegisterdTabs >> @type TabRegister | ||
*/ | ||
export declare const initTabs: (RegisterdTabs: TabRegister) => void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** there all validators @functions exporting for validate string, objects, arrays etc from one place */ | ||
import checkPathParam from './validators/checkPathParam'; | ||
import isPathParamPattern from './validators/isPathParamPattern'; | ||
declare const RmValidator: { | ||
isValidUrl: (str: string) => boolean; | ||
isEmptyObject: (obj: object) => boolean; | ||
parseQueryString: (query: string) => object; | ||
parseObjectToQueryString: (obj: object) => string; | ||
isValidServerHost: (server_host: string) => boolean; | ||
checkPathParam: typeof checkPathParam; | ||
isPathParamPattern: typeof isPathParamPattern; | ||
}; | ||
export default RmValidator; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { type Route, type RouteEngineInput } from './types'; | ||
export declare const RouteEngineInit: (Input: RouteEngineInput) => void; | ||
export declare const route: (Route: Route) => void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { registerMetaUrl, registerServerHost, register_http_routes, register_routes_footers, register_routes_headers } from './RmRegister'; | ||
import { navigate, pop_route, push_route } from './Navigators'; | ||
import { initTabs } from './RmTabsHandler'; | ||
import { render, await_rendering } from './RmRender'; | ||
import { localState } from './RmStateManager'; | ||
export { registerMetaUrl, registerServerHost, register_http_routes, register_routes_footers, register_routes_headers, navigate, render, await_rendering, pop_route, push_route, initTabs, localState, }; |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.