model

package
v2.2.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: AGPL-3.0 Imports: 34 Imported by: 0

Documentation

Overview

Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Index

Constants

View Source
const KvRootType = `root`

Variables

View Source
var (
	// SMSWaitingSeconds 短信发送后等待秒数
	SMSWaitingSeconds int64 = 60
	// SMSMaxPerDay 短信每人每天发送上限
	SMSMaxPerDay int64 = 10
)
View Source
var (
	ErrNoneFtpDirectory = errors.New(`No accessible directory`)
	ErrBannedFtpUser    = errors.New(`The current account has been disabled`)
)
View Source
var CaddyLogRegexpList = sync.Map{}
View Source
var (
	Decode = func(r string) string { return r }
)
View Source
var DefaultSalt = ``

Functions

func AlertSend

func AlertSend(ctx echo.Context, topic string, params param.Store) error

Types

type AccessLog

type AccessLog struct {
	*dbschema.NgingAccessLog
	// contains filtered or unexported fields
}

func NewAccessLog

func NewAccessLog(ctx echo.Context) *AccessLog

func (*AccessLog) Parse

func (l *AccessLog) Parse(line string, args ...interface{}) (err error)

Parse 解析单行字符串到日志对象

func (*AccessLog) ToLite

func (m *AccessLog) ToLite() *AccessLogLite

func (*AccessLog) ToMap

func (m *AccessLog) ToMap() echo.Store

type AccessLogLite

type AccessLogLite struct {
	Date   string
	OS     string
	Brower string
	Region string
	Type   string

	Version string
	User    string
	Method  string
	Scheme  string
	Host    string
	URI     string

	Referer string

	BodyBytes  uint64
	Elapsed    float64
	StatusCode uint
	UserAgent  string
}

type AlertRecipient

type AlertRecipient struct {
	*dbschema.NgingAlertRecipient
	// contains filtered or unexported fields
}

func NewAlertRecipient

func NewAlertRecipient(ctx echo.Context) *AlertRecipient

func (*AlertRecipient) Add

func (s *AlertRecipient) Add() (pk interface{}, err error)

func (*AlertRecipient) Delete

func (s *AlertRecipient) Delete(mw func(db.Result) db.Result, args ...interface{}) (err error)

func (*AlertRecipient) Edit

func (s *AlertRecipient) Edit(mw func(db.Result) db.Result, args ...interface{}) (err error)

func (*AlertRecipient) GetWithExt

func (s *AlertRecipient) GetWithExt(mw func(db.Result) db.Result, args ...interface{}) (row *AlertRecipientExt, err error)

type AlertRecipientExt

type AlertRecipientExt struct {
	*dbschema.NgingAlertRecipient
	Extra echo.H
}

func (*AlertRecipientExt) Parse

func (*AlertRecipientExt) Send

func (a *AlertRecipientExt) Send(params param.Store) (err error)

type AlertTopic

type AlertTopic struct {
	*dbschema.NgingAlertTopic
	// contains filtered or unexported fields
}

func NewAlertTopic

func NewAlertTopic(ctx echo.Context) *AlertTopic

func (*AlertTopic) Add

func (s *AlertTopic) Add(rows ...*dbschema.NgingAlertTopic) (pk interface{}, err error)

func (*AlertTopic) Edit

func (s *AlertTopic) Edit(mw func(db.Result) db.Result, args ...interface{}) (err error)

func (*AlertTopic) Exists

func (s *AlertTopic) Exists(topic string, recipientId uint) (bool, error)

func (*AlertTopic) ExistsOther

func (s *AlertTopic) ExistsOther(topic string, recipientId uint, excludeID uint) (bool, error)

func (*AlertTopic) Send

func (s *AlertTopic) Send(topic string, params param.Store) (err error)

type AlertTopicExt

type AlertTopicExt struct {
	*dbschema.NgingAlertTopic
	Recipient *dbschema.NgingAlertRecipient `db:"-,relation=id:recipient_id"`
	Extra     echo.H
}

func (*AlertTopicExt) Parse

func (a *AlertTopicExt) Parse() *AlertTopicExt

func (*AlertTopicExt) Send

func (a *AlertTopicExt) Send(params param.Store) (err error)

type CloudStorage

type CloudStorage struct {
	*dbschema.NgingCloudStorage
	// contains filtered or unexported fields
}

func NewCloudStorage

func NewCloudStorage(ctx echo.Context) *CloudStorage

func (*CloudStorage) Add

func (s *CloudStorage) Add() (pk interface{}, err error)

func (*CloudStorage) BaseURL

func (s *CloudStorage) BaseURL() string

func (*CloudStorage) CachedList

func (s *CloudStorage) CachedList() map[string]*dbschema.NgingCloudStorage

func (*CloudStorage) Edit

func (s *CloudStorage) Edit(mw func(db.Result) db.Result, args ...interface{}) (err error)

func (*CloudStorage) Get

func (s *CloudStorage) Get(mw func(db.Result) db.Result, args ...interface{}) error

func (*CloudStorage) RawSecret

func (s *CloudStorage) RawSecret() string

type Code

type Code struct {
	Verification *dbschema.NgingCodeVerification
	Invitation   *dbschema.NgingCodeInvitation
	*base.Base
}

func NewCode

func NewCode(ctx echo.Context) *Code

func (*Code) AddVerificationCode

func (c *Code) AddVerificationCode() (interface{}, error)

func (*Code) CheckFrequency

func (c *Code) CheckFrequency(ownerID uint64, ownerType string, sendMethod string, frequencyCfg echo.H) error

func (*Code) CheckVerificationCode

func (c *Code) CheckVerificationCode(code string, purpose string, ownerID uint64, ownerType string, sendMethod string, sendTo string) (err error)

func (*Code) CountTodayVerificationCode

func (c *Code) CountTodayVerificationCode(ownerID uint64, ownerType string, sendMethod string) (int64, error)

func (*Code) LastVerificationCode

func (c *Code) LastVerificationCode(ownerID uint64, ownerType string, sendMethod string) (err error)

func (*Code) UseInvitationCode

func (c *Code) UseInvitationCode(m *dbschema.NgingCodeInvitation, usedUid uint) (err error)

func (*Code) UseVerificationCode

func (c *Code) UseVerificationCode(m *dbschema.NgingCodeVerification) (err error)

func (*Code) VerfyInvitationCode

func (c *Code) VerfyInvitationCode(code string) (err error)

type CollectorExport

type CollectorExport struct {
	*dbschema.NgingCollectorExport
	*base.Base
}

func NewCollectorExport

func NewCollectorExport(ctx echo.Context) *CollectorExport

func (*CollectorExport) Add

func (c *CollectorExport) Add() (pk interface{}, err error)

func (*CollectorExport) Edit

func (c *CollectorExport) Edit(mw func(db.Result) db.Result, args ...interface{}) error

func (*CollectorExport) Export

func (c *CollectorExport) Export() (int64, error)

type CollectorExportAndGroup

type CollectorExportAndGroup struct {
	*dbschema.NgingCollectorExport
	Group *dbschema.NgingCollectorGroup
}

type CollectorGroup

type CollectorGroup struct {
	*dbschema.NgingCollectorGroup
	*base.Base
}

func NewCollectorGroup

func NewCollectorGroup(ctx echo.Context) *CollectorGroup

type CollectorHistory

type CollectorHistory struct {
	*dbschema.NgingCollectorHistory
	*base.Base
}

func NewCollectorHistory

func NewCollectorHistory(ctx echo.Context) *CollectorHistory

func (*CollectorHistory) Delete

func (this *CollectorHistory) Delete(mw func(db.Result) db.Result, args ...interface{}) error

func (*CollectorHistory) Reset

func (c *CollectorHistory) Reset() *CollectorHistory

type CollectorPage

type CollectorPage struct {
	*dbschema.NgingCollectorPage
	*base.Base
}

func NewCollectorPage

func NewCollectorPage(ctx echo.Context) *CollectorPage

func (*CollectorPage) FullData

func (c *CollectorPage) FullData() (*exec.Rules, error)

type CollectorPageAndGroup

type CollectorPageAndGroup struct {
	*dbschema.NgingCollectorPage
	Group *dbschema.NgingCollectorGroup `db:"-,relation=id:group_id|gtZero"`
}

type CollectorRule

type CollectorRule struct {
	*dbschema.NgingCollectorRule
	*base.Base
}

func NewCollectorRule

func NewCollectorRule(ctx echo.Context) *CollectorRule

type Command

type Command struct {
	*dbschema.NgingCommand
	*base.Base
}

func NewCommand

func NewCommand(ctx echo.Context) *Command

func (*Command) CreateCmd

func (u *Command) CreateCmd() *exec.Cmd

func (*Command) Exists

func (u *Command) Exists(name string) (bool, error)

func (*Command) Exists2

func (u *Command) Exists2(name string, excludeID uint) (bool, error)

type Config

type Config struct {
	*dbschema.NgingConfig
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(ctx echo.Context) *Config

func (*Config) Add

func (f *Config) Add() (pk interface{}, err error)

func (*Config) Edit

func (f *Config) Edit(mw func(db.Result) db.Result, args ...interface{}) error

func (*Config) EditByPK

func (f *Config) EditByPK(mw func(db.Result) db.Result, group string, key string) error

func (*Config) ListAllMapByGroup

func (f *Config) ListAllMapByGroup() (echo.H, error)

func (*Config) ListByGroup

func (f *Config) ListByGroup(group string) (func() int64, error)

func (*Config) ListMapByGroup

func (f *Config) ListMapByGroup(group string) (echo.H, error)

func (*Config) Upsert

func (f *Config) Upsert() (pk interface{}, err error)

func (*Config) ValueByKey

func (f *Config) ValueByKey(group, key string) string

type DbAccount added in v1.3.0

type DbAccount struct {
	*dbschema.NgingDbAccount
	*base.Base
}

func NewDbAccount added in v1.3.0

func NewDbAccount(ctx echo.Context) *DbAccount

func (*DbAccount) Add added in v1.3.0

func (a *DbAccount) Add() (interface{}, error)

func (*DbAccount) Edit added in v1.3.0

func (a *DbAccount) Edit(id uint, mw func(db.Result) db.Result, args ...interface{}) error

func (*DbAccount) SetOptions

func (a *DbAccount) SetOptions() error

type DbSync

type DbSync struct {
	*dbschema.NgingDbSync
	*base.Base
}

func NewDbSync

func NewDbSync(ctx echo.Context) *DbSync

func (*DbSync) Add

func (a *DbSync) Add() (interface{}, error)

func (*DbSync) Edit

func (a *DbSync) Edit(mw func(db.Result) db.Result, args ...interface{}) error

func (*DbSync) HidePassword

func (a *DbSync) HidePassword(dsn string) string

func (*DbSync) ParseDSN

func (a *DbSync) ParseDSN(dsn string) (user string, pwd string, host string, dbName string)

func (*DbSync) ToDSN

func (a *DbSync) ToDSN(user, pwd, host, db string) string

func (*DbSync) ToDSNFromAccount

func (a *DbSync) ToDSNFromAccount(acc *dbschema.NgingDbAccount) string

type DbSyncLog

type DbSyncLog struct {
	*dbschema.NgingDbSyncLog
	*base.Base
}

func NewDbSyncLog

func NewDbSyncLog(ctx echo.Context) *DbSyncLog

func (*DbSyncLog) Add

func (a *DbSyncLog) Add() (interface{}, error)

func (*DbSyncLog) Edit

func (a *DbSyncLog) Edit(mw func(db.Result) db.Result, args ...interface{}) error

type DbSyncWithAccount

type DbSyncWithAccount struct {
	*dbschema.NgingDbSync
	SrcAccount *dbschema.NgingDbAccount `db:"-,relation=id:source_account_id"`
	DstAccount *dbschema.NgingDbAccount `db:"-,relation=id:destination_account_id"`
}

type ForeverProcess

type ForeverProcess struct {
	*dbschema.NgingForeverProcess
	*base.Base
}

func NewForeverProcess

func NewForeverProcess(ctx echo.Context) *ForeverProcess

func (*ForeverProcess) Add

func (u *ForeverProcess) Add() (pk interface{}, err error)

func (*ForeverProcess) ArgsSlice

func (u *ForeverProcess) ArgsSlice() []string

func (*ForeverProcess) Edit

func (u *ForeverProcess) Edit(mw func(db.Result) db.Result, args ...interface{}) error

func (*ForeverProcess) EnvSlice

func (u *ForeverProcess) EnvSlice() []string

func (*ForeverProcess) Exists

func (u *ForeverProcess) Exists(name string) (bool, error)

func (*ForeverProcess) Exists2

func (u *ForeverProcess) Exists2(name string, excludeID uint) (bool, error)

type FrpClient

type FrpClient struct {
	*dbschema.NgingFrpClient
	*base.Base
}

func NewFrpClient

func NewFrpClient(ctx echo.Context) *FrpClient

func (*FrpClient) Exists

func (f *FrpClient) Exists(name string, excludeIds ...uint) (bool, error)

type FrpClientAndGroup

type FrpClientAndGroup struct {
	*dbschema.NgingFrpClient
	Group   *dbschema.NgingFrpGroup `db:"-,relation=id:group_id|gtZero"`
	Running bool
}

type FrpGroup

type FrpGroup struct {
	*dbschema.NgingFrpGroup
	*base.Base
}

func NewFrpGroup

func NewFrpGroup(ctx echo.Context) *FrpGroup

func (*FrpGroup) Exists

func (f *FrpGroup) Exists(name string) (bool, error)

func (*FrpGroup) ExistsOther

func (f *FrpGroup) ExistsOther(name string, id uint) (bool, error)

type FrpServer

type FrpServer struct {
	*dbschema.NgingFrpServer
	*base.Base
}

func NewFrpServer

func NewFrpServer(ctx echo.Context) *FrpServer

func (*FrpServer) Exists

func (f *FrpServer) Exists(name string, excludeIds ...uint) (bool, error)

type FrpServerAndGroup

type FrpServerAndGroup struct {
	*dbschema.NgingFrpServer
	Group   *dbschema.NgingFrpGroup `db:"-,relation=id:group_id|gtZero"`
	Running bool
}

type FtpUser

type FtpUser struct {
	*dbschema.NgingFtpUser
	*base.Base
}

func NewFtpUser

func NewFtpUser(ctx echo.Context) *FtpUser

func (*FtpUser) CheckPasswd

func (f *FtpUser) CheckPasswd(username string, password string) (bool, error)

func (*FtpUser) Exists

func (f *FtpUser) Exists(username string) (bool, error)

func (*FtpUser) RootPath

func (f *FtpUser) RootPath(username string) (basePath string, err error)

type FtpUserAndGroup

type FtpUserAndGroup struct {
	*dbschema.NgingFtpUser
	Group *dbschema.NgingFtpUserGroup `db:"-,relation=id:group_id|gtZero"`
}

type FtpUserGroup

type FtpUserGroup struct {
	*dbschema.NgingFtpUserGroup
	*base.Base
}

func NewFtpUserGroup

func NewFtpUserGroup(ctx echo.Context) *FtpUserGroup

func (*FtpUserGroup) Exists

func (f *FtpUserGroup) Exists(name string) (bool, error)

func (*FtpUserGroup) ExistsOther

func (f *FtpUserGroup) ExistsOther(name string, id uint) (bool, error)

func (*FtpUserGroup) ListByActive

func (f *FtpUserGroup) ListByActive(page int, size int) (func() int64, []*dbschema.NgingFtpUserGroup, error)

type Invitation

type Invitation struct {
	*dbschema.NgingCodeInvitation
	*base.Base
}

func NewInvitation

func NewInvitation(ctx echo.Context) *Invitation

func (*Invitation) Exists

func (u *Invitation) Exists(code string) (bool, error)

func (*Invitation) Exists2

func (u *Invitation) Exists2(code string, excludeID uint) (bool, error)

type Kv

type Kv struct {
	*dbschema.NgingKv
	// contains filtered or unexported fields
}

func NewKv

func NewKv(ctx echo.Context) *Kv

func (*Kv) Add

func (s *Kv) Add() (pk interface{}, err error)

func (*Kv) Delete

func (s *Kv) Delete(mw func(db.Result) db.Result, args ...interface{}) (err error)

func (*Kv) Edit

func (s *Kv) Edit(mw func(db.Result) db.Result, args ...interface{}) (err error)

func (*Kv) Get

func (s *Kv) Get(mw func(db.Result) db.Result, args ...interface{}) error

func (*Kv) GetFromTypeList

func (s *Kv) GetFromTypeList(typeList []*dbschema.NgingKv, key string) string

func (*Kv) IsRootType

func (s *Kv) IsRootType(typ string) bool

func (*Kv) KvTypeList

func (s *Kv) KvTypeList(excludeIDs ...uint) []*dbschema.NgingKv

func (*Kv) ListByType

func (s *Kv) ListByType(typ string, excludeIDs ...uint) []*dbschema.NgingKv

func (*Kv) ListToMap

func (s *Kv) ListToMap(typeList []*dbschema.NgingKv) map[string]*dbschema.NgingKv

func (*Kv) SetSingleField

func (s *Kv) SetSingleField(id int, field string, value string) error

type SendingLog

type SendingLog struct {
	*dbschema.NgingSendingLog
	*base.Base
}

func NewSendingLog

func NewSendingLog(ctx echo.Context) *SendingLog

func (*SendingLog) Add

func (c *SendingLog) Add() (interface{}, error)

type SshUser

type SshUser struct {
	*dbschema.NgingSshUser
	*base.Base
}

func NewSshUser

func NewSshUser(ctx echo.Context) *SshUser

func (*SshUser) Connect

func (s *SshUser) Connect(reader io.Reader, writer io.Writer) error

func (*SshUser) ExecMultiCMD

func (s *SshUser) ExecMultiCMD(writer io.Writer, commands ...string) error

type SshUserAndGroup

type SshUserAndGroup struct {
	*dbschema.NgingSshUser
	Group *dbschema.NgingSshUserGroup
}

type SshUserGroup

type SshUserGroup struct {
	*dbschema.NgingSshUserGroup
	*base.Base
}

func NewSshUserGroup

func NewSshUserGroup(ctx echo.Context) *SshUserGroup

func (*SshUserGroup) Exists

func (f *SshUserGroup) Exists(name string) (bool, error)

func (*SshUserGroup) ExistsOther

func (f *SshUserGroup) ExistsOther(name string, id uint) (bool, error)

type Task

type Task struct {
	*dbschema.NgingTask
	*base.Base
}

func NewTask

func NewTask(ctx echo.Context) *Task

type TaskAndGroup

type TaskAndGroup struct {
	*dbschema.NgingTask
	Group *dbschema.NgingTaskGroup `db:"-,relation=id:group_id|gtZero"`
}

type TaskGroup

type TaskGroup struct {
	*dbschema.NgingTaskGroup
	*base.Base
}

func NewTaskGroup

func NewTaskGroup(ctx echo.Context) *TaskGroup

type TaskLog

type TaskLog struct {
	*dbschema.NgingTaskLog
	*base.Base
}

func NewTaskLog

func NewTaskLog(ctx echo.Context) *TaskLog

type User

type User struct {
	*dbschema.NgingUser
	// contains filtered or unexported fields
}

func NewUser

func NewUser(ctx echo.Context) *User

func (*User) Add

func (u *User) Add() (err error)

func (*User) CheckPasswd

func (u *User) CheckPasswd(username string, password string) (exists bool, err error)

func (*User) ClearPasswordData

func (u *User) ClearPasswordData(users ...*dbschema.NgingUser) dbschema.NgingUser

func (*User) Exists

func (u *User) Exists(username string) (bool, error)

func (*User) Exists2

func (u *User) Exists2(username string, excludeUID uint) (bool, error)

func (*User) GetUserAllU2F

func (u *User) GetUserAllU2F(uid uint) ([]*dbschema.NgingUserU2f, error)

func (*User) NeedCheckU2F

func (u *User) NeedCheckU2F(uid uint) bool

func (*User) Register

func (u *User) Register(user, pass, email, roleIds string) error

func (*User) SetSession

func (u *User) SetSession(users ...*dbschema.NgingUser)

func (*User) U2F

func (u *User) U2F(uid uint, typ string) (u2f *dbschema.NgingUserU2f, err error)

func (*User) UnsetSession

func (u *User) UnsetSession()

func (*User) UpdateField

func (u *User) UpdateField(uid uint, set map[string]interface{}) (err error)

func (*User) VerifySession

func (u *User) VerifySession(users ...*dbschema.NgingUser) error

type UserRole

type UserRole struct {
	*dbschema.NgingUserRole
	*base.Base
	// contains filtered or unexported fields
}

func NewUserRole

func NewUserRole(ctx echo.Context) *UserRole

func (*UserRole) CheckCmdPerm

func (u *UserRole) CheckCmdPerm(permPath string) bool

func (*UserRole) CheckCmdPerm2

func (u *UserRole) CheckCmdPerm2(roleList []*dbschema.NgingUserRole, perm string) (hasPerm bool)

func (*UserRole) CheckPerm

func (u *UserRole) CheckPerm(permPath string) bool

func (*UserRole) CheckPerm2

func (u *UserRole) CheckPerm2(roleList []*dbschema.NgingUserRole, perm string) (hasPerm bool)

func (*UserRole) CleanPermAction

func (u *UserRole) CleanPermAction(values []string) *UserRole

func (*UserRole) Exists

func (u *UserRole) Exists(name string) (bool, error)

func (*UserRole) Exists2

func (u *UserRole) Exists2(name string, excludeID uint) (bool, error)

func (*UserRole) FilterNavigate

func (u *UserRole) FilterNavigate(roleList []*dbschema.NgingUserRole, navList *navigate.List) navigate.List

FilterNavigate 过滤导航菜单,只显示有权限的菜单

func (*UserRole) ListByUser

func (u *UserRole) ListByUser(user *dbschema.NgingUser) (roleList []*dbschema.NgingUserRole)

type Verification

type Verification struct {
	*dbschema.NgingCodeVerification
	*base.Base
}

func NewVerification

func NewVerification(ctx echo.Context) *Verification

type Vhost

type Vhost struct {
	*dbschema.NgingVhost
	*base.Base
}

func NewVhost

func NewVhost(ctx echo.Context) *Vhost

type VhostAndGroup

type VhostAndGroup struct {
	*dbschema.NgingVhost
	Group *dbschema.NgingVhostGroup `db:"-,relation=id:group_id|gtZero"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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