db

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ExpirationPeriod = 24 * time.Hour

Variables

This section is empty.

Functions

func NotDeleted

func NotDeleted(db *gorm.DB) *gorm.DB

Types

type Client

type Client struct {
	gorm.DB
}

type Guide

type Guide struct {
	ID            string `gorm:"primary_key"`
	Status        string
	Kind          string
	Creator       string
	OrgID         uint64
	OrgName       string
	ProjectID     uint64
	AppID         uint64
	AppName       string
	Branch        string
	CreatedAt     time.Time
	UpdatedAt     time.Time
	Content       JSON
	SoftDeletedAt uint64
}

func (*Guide) Convert

func (g *Guide) Convert() *pb.Guide

func (Guide) TableName

func (Guide) TableName() string

type GuideDB

type GuideDB struct {
	*dao.DBClient
}

func (*GuideDB) BatchUpdateGuideExpiryStatus

func (db *GuideDB) BatchUpdateGuideExpiryStatus() error

BatchUpdateGuideExpiryStatus .

func (*GuideDB) CancelGuide

func (db *GuideDB) CancelGuide(id string) error

CancelGuide .

func (*GuideDB) CheckUniqueByAppIDAndBranch

func (db *GuideDB) CheckUniqueByAppIDAndBranch(appID uint64, branch, kind string) (bool, error)

func (*GuideDB) CreateGuide

func (db *GuideDB) CreateGuide(guide *Guide) error

CreateGuide .

func (*GuideDB) GetGuide

func (db *GuideDB) GetGuide(id string) (guide Guide, err error)

GetGuide .

func (*GuideDB) GetGuideByAppIDAndBranch

func (db *GuideDB) GetGuideByAppIDAndBranch(appID uint64, branch, kind string) (guide Guide, err error)

GetGuideByAppIDAndBranch .

func (*GuideDB) ListGuide

func (db *GuideDB) ListGuide(req *pb.ListGuideRequest, userID string) (guides []Guide, err error)

ListGuide .

func (*GuideDB) UpdateGuide

func (db *GuideDB) UpdateGuide(id string, fields map[string]interface{}) error

UpdateGuide .

func (*GuideDB) UpdateGuideByAppIDAndBranch

func (db *GuideDB) UpdateGuideByAppIDAndBranch(appID uint64, branch, kind string, fields map[string]interface{}) error

UpdateGuideByAppIDAndBranch .

type GuideKind

type GuideKind string
const (
	PipelineGuide GuideKind = "pipeline"
)

func (GuideKind) String

func (g GuideKind) String() string

type GuideStatus

type GuideStatus string
const (
	InitStatus      GuideStatus = "init"
	ProcessedStatus GuideStatus = "processed"
	ExpiredStatus   GuideStatus = "expired"
	CanceledStatus  GuideStatus = "canceled"
)

func (GuideStatus) String

func (g GuideStatus) String() string

type JSON

type JSON json.RawMessage

func (*JSON) Scan

func (j *JSON) Scan(value interface{}) error

func (JSON) String

func (j JSON) String() string

func (JSON) Value

func (j JSON) Value() (driver.Value, error)

type PipelineContent

type PipelineContent struct {
	Branch       string   `json:"branch"`
	PipelineYmls []string `json:"pipelineYmls"`
}

Jump to

Keyboard shortcuts

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