model

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoneFtpDirectory = errors.New(`No accessible directory`)
	ErrBannedFtpUser    = errors.New(`The current account has been disabled`)
)
View Source
var DefaultSalt = ``

Functions

This section is empty.

Types

type Base

type Base struct {
	echo.Context
}

type Code

type Code struct {
	Verification *dbschema.CodeVerification
	Invitation   *dbschema.CodeInvitation
	*Base
}

func NewCode

func NewCode(ctx echo.Context) *Code

func (*Code) UseInvitationCode

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

func (*Code) VerfyInvitationCode

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

type DbAccount added in v1.3.0

type DbAccount struct {
	*dbschema.DbAccount
	*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(mw func(db.Result) db.Result, args ...interface{}) error

type FtpUser

type FtpUser struct {
	*dbschema.FtpUser
	*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.FtpUser
	Group *dbschema.FtpUserGroup
}

type FtpUserGroup

type FtpUserGroup struct {
	*dbschema.FtpUserGroup
	*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.FtpUserGroup, error)

type Task

type Task struct {
	*dbschema.Task
	*Base
}

func NewTask

func NewTask(ctx echo.Context) *Task

type TaskAndGroup

type TaskAndGroup struct {
	*dbschema.Task
	Group *dbschema.TaskGroup
}

type TaskGroup

type TaskGroup struct {
	*dbschema.TaskGroup
	*Base
}

func NewTaskGroup

func NewTaskGroup(ctx echo.Context) *TaskGroup

type TaskLog

type TaskLog struct {
	*dbschema.TaskLog
	*Base
}

func NewTaskLog

func NewTaskLog(ctx echo.Context) *TaskLog

type User

type User struct {
	*dbschema.User
	*Base
}

func NewUser

func NewUser(ctx echo.Context) *User

func (*User) CheckPasswd

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

func (*User) Exists

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

func (*User) GetUserAllU2F

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

func (*User) NeedCheckU2F

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

func (*User) Register

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

func (*User) SetSession

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

func (*User) U2F

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

type Vhost

type Vhost struct {
	*dbschema.Vhost
	*Base
}

func NewVhost

func NewVhost(ctx echo.Context) *Vhost

Jump to

Keyboard shortcuts

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