fabric8-wit: github.com/fabric8-services/fabric8-wit/codebase Index | Files | Directories

package codebase

import "github.com/fabric8-services/fabric8-wit/codebase"

Index

Package Files

codebase.go

Constants

const (
    RepositoryKey = "repository"
    BranchKey     = "branch"
    FileNameKey   = "filename"
    LineNumberKey = "linenumber"
    CodebaseIDKey = "codebaseid"
)

Following keys define attribute names in the map of Codebase

type Codebase Uses

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

func (Codebase) TableName Uses

func (m Codebase) TableName() string

TableName overrides the table name settings in Gorm to force a specific table name in the database.

type Content Uses

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 Uses

func NewCodebaseContent(value map[string]interface{}) (Content, error)

NewCodebaseContent builds Content instance from input Map.

func NewCodebaseContentFromValue Uses

func NewCodebaseContentFromValue(value interface{}) (*Content, error)

NewCodebaseContentFromValue builds Content from interface{}

func (*Content) IsRepoValidURL Uses

func (c *Content) IsRepoValidURL() bool

IsRepoValidURL makes sure Repo is valid GIT URL

func (*Content) IsValid Uses

func (c *Content) IsValid() error

IsValid perform following checks Repository value is mandatory

func (*Content) ToMap Uses

func (c *Content) ToMap() map[string]interface{}

ToMap converts Content to a map of string->Interface{}

type GormCodebaseRepository Uses

type GormCodebaseRepository struct {
    // contains filtered or unexported fields
}

GormCodebaseRepository is the implementation of the storage interface for Codebases.

func (*GormCodebaseRepository) CheckExists Uses

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 Uses

func (m *GormCodebaseRepository) Create(ctx context.Context, codebase *Codebase) error

Create creates a new record.

func (*GormCodebaseRepository) List Uses

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) Load Uses

func (m *GormCodebaseRepository) Load(ctx context.Context, id uuid.UUID) (*Codebase, error)

Load a single codebase regardless of parent

func (*GormCodebaseRepository) LoadByRepo Uses

func (m *GormCodebaseRepository) LoadByRepo(ctx context.Context, spaceID uuid.UUID, repository string) (*Codebase, error)

LoadByRepo returns a single codebase found for input repository url

func (*GormCodebaseRepository) Save Uses

func (m *GormCodebaseRepository) Save(ctx context.Context, codebase *Codebase) (*Codebase, error)

Save a single codebase

type Repository Uses

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 Uses

func NewCodebaseRepository(db *gorm.DB) Repository

NewCodebaseRepository creates a new storage type.

Directories

PathSynopsis
che

Package codebase imports 11 packages (graph) and is imported by 10 packages. Updated 2017-09-25. Refresh now. Tools for package owners.