adminecho

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

README

Go Advanced Admin - Echo Integration

Echo framework integration for the Go Advanced Admin Panel.

Go Report Card Go Go.Dev reference

This package provides integration with the Echo web framework for the Go Advanced Admin Panel, enabling you to use Echo as your web framework.

Installation

Add the module to your project by running:

go get github.com/go-advanced-admin/echo-integration

Documentation

For detailed documentation on how to use the Echo integration, please visit the official documentation website.

Quick Start

import (
    "github.com/go-advanced-admin/admin"
    "github.com/go-advanced-admin/echo-integration"
    "github.com/labstack/echo/v4"
)

func main() {
    // Initialize Echo
    e := echo.New()

    // Initialize the web integrator
    webIntegrator := adminecho.NewIntegrator(e.Group("/admin"))

    // Use webIntegrator when initializing the admin panel
}

For more detailed examples and configuration options, please refer to the Echo Integration Guide.

Contributing

Contributions are always welcome! Please refer to the Contributing Guidelines in the main repository.

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Integrator

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

Integrator struct wraps an Echo group to handle routes and assets for the admin panel

func NewIntegrator

func NewIntegrator(g *echo.Group) *Integrator

NewIntegrator creates a new Integrator instance for the given Echo group

func (*Integrator) GetFormData

func (i *Integrator) GetFormData(ctx interface{}) map[string][]string

GetFormData retrieves form data from the request context

func (*Integrator) GetPathParam

func (i *Integrator) GetPathParam(ctx interface{}, name string) string

GetPathParam extracts a path parameter from the context

func (*Integrator) GetQueryParam

func (i *Integrator) GetQueryParam(ctx interface{}, name string) string

GetQueryParam extracts a query parameter from the context

func (*Integrator) GetRequestMethod

func (i *Integrator) GetRequestMethod(ctx interface{}) string

GetRequestMethod retrieves the HTTP request method from the context

func (*Integrator) HandleRoute

func (i *Integrator) HandleRoute(method, path string, handler admin.HandlerFunc)

HandleRoute adds a route to the Echo group and uses the admin.HandlerFunc for processing requests

func (*Integrator) ServeAssets

func (i *Integrator) ServeAssets(prefix string, renderer admin.TemplateRenderer)

ServeAssets serves static assets by using the provided admin.TemplateRenderer interface

Jump to

Keyboard shortcuts

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