project

package
v0.12.6 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProjectAPI

func NewProjectAPI(ctx context.Context, opt *Options) (_ project.ProjectAPIServer, err error)

func ProjectMemberProto

func ProjectMemberProto(db *ProjectMember) (*project.ProjectMember, error)

func ProjectProto

func ProjectProto(db *Project) (*project.Project, error)

func ValidateProject

func ValidateProject(pb *project.Project) error

func ValidateProjectMember

func ValidateProjectMember(pb *project.ProjectMember) error

Types

type Options

type Options struct {
	AuthAPI auth.API
	SqlDb   *gorm.DB
	Logger  grpclog.LoggerV2
}

type Project

type Project struct {
	ID          uint      `gorm:"primaryKey;autoIncrement"`
	OwnerId     string    `gorm:"index;type:varchar(50);not null"`
	OwnerEmail  string    `gorm:"type:varchar(50)"`
	OwnerNames  string    `gorm:"type:varchar(50)"`
	ProjectName string    `gorm:"type:varchar(50);not null"`
	Description string    `gorm:"type:varchar(150);"`
	Status      string    `gorm:"index;type:varchar(50)"`
	Scopes      []byte    `gorm:"type:json"`
	CreatedAt   time.Time `gorm:"autoCreateTime;->;<-:create;not null;type:datetime(6)"`
	UpdatedAt   time.Time `gorm:"autoUpdateTime;<-;type:datetime(6)"`
	DeletedAt   gorm.DeletedAt
}

func ProjectModel

func ProjectModel(pb *project.Project) (*Project, error)

func (*Project) TableName

func (*Project) TableName() string

type ProjectMember

type ProjectMember struct {
	ID        uint      `gorm:"primaryKey;autoIncrement"`
	UserId    string    `gorm:"index;type:varchar(50);not null"`
	ProjectId string    `gorm:"index;type:varchar(50);not null"`
	Status    string    `gorm:"index;type:varchar(50)"`
	Scopes    []byte    `gorm:"type:json"`
	CreatedAt time.Time `gorm:"autoCreateTime;->;<-:create;not null;type:datetime(6)"`
	UpdatedAt time.Time `gorm:"autoUpdateTime;<-;type:datetime(6)"`
	DeletedAt gorm.DeletedAt
}

func ProjectMemberModel

func ProjectMemberModel(pb *project.ProjectMember) (*ProjectMember, error)

func (*ProjectMember) TableName

func (*ProjectMember) TableName() string

Jump to

Keyboard shortcuts

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