types

package
v0.0.0-...-0b0b839 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RoleAdmin  = "admin"
	RoleMember = "member"
	RoleGuest  = "guest"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

type Buffer struct {
	sync.Mutex

	SyncRead bool
	// contains filtered or unexported fields
}

Buffer:

func NewBuf

func NewBuf() (buf *Buffer)

NewBuf

func (*Buffer) Clear

func (b *Buffer) Clear()

Clear:

func (*Buffer) GetInputTimes

func (b *Buffer) GetInputTimes() int

GetInputTimes:

func (*Buffer) Len

func (b *Buffer) Len() int

Len:

func (*Buffer) Over

func (b *Buffer) Over()

Over:

func (*Buffer) String

func (b *Buffer) String() string

String:

func (*Buffer) Write

func (b *Buffer) Write(data []byte) (int, error)

Write:

type CheckResp

type CheckResp struct {
	ID         bson.ObjectId `json:"id" bson:"_id"`
	ProjectID  bson.ObjectId `json:"project_id" bson:"project_id"`
	SHA1       string        `json:"sha1" bson:"sha1"`
	CommitID   string        `json:"commit_id" bson:"commit_id"`
	Filename   string        `json:"filename" bson:"filename"`
	CheckType  string        `json:"check_type" bson:"check_type"`
	CheckName  string        `json:"check_name" bson:"check_name"`
	LineNumber int           `json:"line" bson:"line"`
	Error      string        `json:"error" bson:"error"`
	Created    time.Time     `json:"created" bson:"created"`
}

type CommitPatch

type CommitPatch struct {
	SHA       string        `json:"sha" bson:"sha"`
	ProjectID bson.ObjectId `json:"project_id" bson:"project_id"`
	Author    string        `json:"author" bson:"author"`
	Message   string        `json:"message" bson:"message"`
}

CommitPatch one commit

type FilePatch

type FilePatch struct {
	ID        bson.ObjectId `json:"id" bson:"_id"`
	ProjectID bson.ObjectId `json:"project_id" bson:"project_id"`
	CommitSHA string        `json:"commit_sha" bson:"commit_sha"`
	Filename  string        `json:"filename" bson:"filename"`
	Mode      string        `json:"mode" bson:"mode"`
	Old       *LinePatch    `json:"old" bson:"old"`
	New       *LinePatch    `json:"new" bson:"new"`
}

FilePatch file changes

type GithubAccount

type GithubAccount struct {
	ID       int    `json:"id" bson:"id"`
	Name     string `json:"name" bson:"name"`
	Login    string `json:"login" bson:"login"`
	Email    string `json:"email" bson:"email"`
	Location string `json:"location" bson:"location"`
	Type     string `json:"type" bson:"type"`

	Password  Password `json:"password" bson:"password"`
	DeployKey Password `json:"deploy_key" bson:"deploy_key"`
	Token     Password `json:"token" bson:"token"`
}

GithubAccount:

type LinePatch

type LinePatch struct {
	Offset int `json:"offset" bson:"offset"`
	Count  int `json:"count" bson:"count"`
}

type Member

type Member struct {
	UserID bson.ObjectId `json:"user_id" bson:"user_id"`
	Role   string        `json:"role" bson:"role"`
}

Member 项目用户,用于权限管理

type Password

type Password string

Password: ******

func (Password) Bytes

func (p Password) Bytes() []byte

Bytes

func (Password) Compare

func (p Password) Compare(passwd []byte) error

Compare

func (Password) Generate

func (p Password) Generate() (Password, error)

Generate

func (Password) MarshalJSON

func (p Password) MarshalJSON() (text []byte, err error)

MarshalJSON: json

type Project

type Project struct {
	ID            bson.ObjectId `json:"id" bson:"_id"`
	OwnerID       bson.ObjectId `json:"owner_id" bson:"owner_id"` // project owner
	Owner         string        `json:"owner" bson:"owner"`       // repos owner
	Name          string        `json:"name" bson:"name"`
	Desc          string        `json:"description" bson:"description"`
	ReposID       int64         `json:"repos_id" bson:"repos_id"`
	ReposName     string        `json:"repos_name" bson:"repos_name"`
	ReposFullname string        `json:"repos_fullname" bson:"repos_fullname"`
	Members       []Member      `json:"members" bson:"members"`
	Created       time.Time     `json:"created" bson:"created"`
}

Project 构建项目

type User

type User struct {
	ID       bson.ObjectId `json:"id" bson:"_id"`
	Name     string        `json:"name" bson:"name"`
	Email    string        `json:"email" bson:"email"`
	Phone    string        `json:"phone" bson:"phone"`
	Password Password      `json:"password" bson:"password"`
	Role     string        `json:"role" bson:"role"`

	Created   time.Time `json:"created" bson:"created"`
	Updated   time.Time `json:"updated" bson:"updated"`
	LastLogin time.Time `json:"last_login" bson:"last_login"`

	GithubAccount *GithubAccount `json:"github,omitempty" bson:"github,omitempty"`
	WechatAccount *WechatAccount `json:"wechat,omitempty" bson:"wechat,omitempty"`
}

User:

type UserAuth

type UserAuth struct {
	ID      bson.ObjectId `json:"id" bson:"_id"`
	UserID  bson.ObjectId `json:"user_id" bson:"user_id"`
	Token   string        `json:"token" bson:"token"`
	Created time.Time     `json:"created" bson:"created"`
	Lasted  time.Time     `json:"lasted" bson:"lasted"`
	Expired time.Time     `json:"expired" bson:"expired"`
}

UserAuth:

type WechatAccount

type WechatAccount struct {
	Name string `json:"name" bson:"name"`
}

WechatAccount:

type WriteHandler

type WriteHandler interface{}

WriteHandler:

Jump to

Keyboard shortcuts

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