model

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSystemAttr

func IsSystemAttr(attr string) bool

func ParseSessionID

func ParseSessionID(fullSessionID string) (pageID int, sessionID string)

Types

type Control

type Control map[string]interface{}

Control is an element of a page.

func NewControl

func NewControl(controlType string, parentID string, id string) *Control

NewControl initializes a new control object.

func NewControlFromJSON

func NewControlFromJSON(jsonCtrl string) (*Control, error)

NewControlFromJSON initializes a new control instance from JSON.

func (*Control) AddChildID

func (ctl *Control) AddChildID(childID string)

AddChildID appends the child to the parent control.

func (*Control) AppendAttr

func (ctl *Control) AppendAttr(name string, value string)

func (*Control) At

func (ctl *Control) At() int

func (*Control) GetAttr

func (ctl *Control) GetAttr(name string) interface{}

func (*Control) GetChildrenIds

func (ctl *Control) GetChildrenIds() []string

func (*Control) ID

func (ctl *Control) ID() string

ID returns control's ID.

func (*Control) InsertChildID

func (ctl *Control) InsertChildID(childID string, at int)

func (*Control) ParentID

func (ctl *Control) ParentID() string

ParentID returns the ID of parent control.

func (*Control) RemoveChild

func (ctl *Control) RemoveChild(childID string)

func (*Control) RemoveChildren

func (ctl *Control) RemoveChildren()

func (*Control) SetAttr

func (ctl *Control) SetAttr(name string, value string)

type Page

type Page struct {
	ID          int    `json:"id" redis:"id"`
	Name        string `json:"name" redis:"name"`
	ClientIP    string `json:"clientIP" redis:"clientIP"`
	IsApp       bool   `json:"isApp" redis:"isApp"`
	Permissions string `json:"permissions" redis:"permissions"`
}

Page represents a single page.

func NewPage

func NewPage(name string, isApp bool, permissions string, clientIP string) *Page

NewPage creates a new instance of Page.

type PageName

type PageName struct {
	Account string
	Name    string
}

func ParsePageName

func ParsePageName(pageName string) (*PageName, error)

func (*PageName) IsReserved added in v0.1.14

func (pn *PageName) IsReserved() bool

func (*PageName) String

func (pn *PageName) String() string

type Session

type Session struct {
	Page        *Page  `json:"-"`
	ID          string `json:"id" redis:"id"`
	ClientIP    string `json:"clientIP" redis:"clientIP"`
	PrincipalID string `json:"principalId" redis:"principalID"`
}

Jump to

Keyboard shortcuts

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