menuservice

package
v0.0.0-...-48c4086 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "menu"

Variables

This section is empty.

Functions

func HandleMenuTree

func HandleMenuTree(menus []*models.Action, menuItems []*models.MenuItem, log *logging.Logger) []*permpb.MenuItem

Types

type Config

type Config struct {
	Path         string           `mapstructure:"path"`
	PrintRoute   bool             `mapstructure:"print-route"`
	DefaultMenus []*defaultMethod `mapstructure:"default-menus"`
}

func (Config) Check

func (c Config) Check() error
type Menu struct {
	// contains filtered or unexported fields
}

func New

func New(c *Config, db *orm.Client, l *logging.Logger) *Menu
func (m *Menu) GetAllCode() map[string]bool
func (m *Menu) GetMethodName(method, url string) (string, error)
func (m *Menu) IsDefaultMenu(name string) bool
func (m *Menu) ListEndpointsWithCode(args ...interface{}) ([]*models.Endpoint, error)
func (m *Menu) LoadMenusFromDb() error

LoadMenusFromDb load menu, casbin method enforce (method,path)=>code

func (m *Menu) SaveLocalMenusToDb()

Jump to

Keyboard shortcuts

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