Documentation ¶
Index ¶
- Constants
- type Codebase
- type Content
- type GormCodebaseRepository
- func (m *GormCodebaseRepository) CheckExists(ctx context.Context, id string) error
- func (m *GormCodebaseRepository) Create(ctx context.Context, codebase *Codebase) error
- func (m *GormCodebaseRepository) List(ctx context.Context, spaceID uuid.UUID, start *int, limit *int) ([]*Codebase, uint64, error)
- func (m *GormCodebaseRepository) Load(ctx context.Context, id uuid.UUID) (*Codebase, error)
- func (m *GormCodebaseRepository) LoadByRepo(ctx context.Context, spaceID uuid.UUID, repository string) (*Codebase, error)
- func (m *GormCodebaseRepository) Save(ctx context.Context, codebase *Codebase) (*Codebase, error)
- type Repository
Constants ¶
const ( RepositoryKey = "repository" BranchKey = "branch" FileNameKey = "filename" LineNumberKey = "linenumber" CodebaseIDKey = "codebaseid" )
Following keys define attribute names in the map of Codebase
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codebase ¶
type Codebase struct { gormsupport.Lifecycle ID uuid.UUID `sql:"type:uuid default uuid_generate_v4()" gorm:"primary_key"` // This is the ID PK field SpaceID uuid.UUID `sql:"type:uuid"` Type string URL string StackID *string LastUsedWorkspace string }
Codebase describes a single codebase
type Content ¶
type Content struct { Repository string `json:"repository"` Branch string `json:"branch"` FileName string `json:"filename"` LineNumber int `json:"linenumber"` CodebaseID string `json:"codebaseid"` }
Content defines all parameters those are useful to associate Che Editor's window to a WI
func NewCodebaseContent ¶
NewCodebaseContent builds Content instance from input Map.
func NewCodebaseContentFromValue ¶
NewCodebaseContentFromValue builds Content from interface{}
func (*Content) IsRepoValidURL ¶
IsRepoValidURL makes sure Repo is valid GIT URL
type GormCodebaseRepository ¶
type GormCodebaseRepository struct {
// contains filtered or unexported fields
}
GormCodebaseRepository is the implementation of the storage interface for Codebases.
func (*GormCodebaseRepository) CheckExists ¶
func (m *GormCodebaseRepository) CheckExists(ctx context.Context, id string) error
CheckExists returns nil if the given ID exists otherwise returns an error
func (*GormCodebaseRepository) Create ¶
func (m *GormCodebaseRepository) Create(ctx context.Context, codebase *Codebase) error
Create creates a new record.
func (*GormCodebaseRepository) List ¶
func (m *GormCodebaseRepository) List(ctx context.Context, spaceID uuid.UUID, start *int, limit *int) ([]*Codebase, uint64, error)
List all codebases related to a single item
func (*GormCodebaseRepository) LoadByRepo ¶
func (m *GormCodebaseRepository) LoadByRepo(ctx context.Context, spaceID uuid.UUID, repository string) (*Codebase, error)
LoadByRepo returns a single codebase found for input repository url
type Repository ¶
type Repository interface { repository.Exister Create(ctx context.Context, u *Codebase) error Save(ctx context.Context, codebase *Codebase) (*Codebase, error) List(ctx context.Context, spaceID uuid.UUID, start *int, limit *int) ([]*Codebase, uint64, error) Load(ctx context.Context, id uuid.UUID) (*Codebase, error) LoadByRepo(ctx context.Context, spaceID uuid.UUID, repository string) (*Codebase, error) }
Repository describes interactions with codebases
func NewCodebaseRepository ¶
func NewCodebaseRepository(db *gorm.DB) Repository
NewCodebaseRepository creates a new storage type.