Documentation ¶
Index ¶
- Variables
- func ErrInvalidRepositoryPath(path string) error
- func Serve(scanner GRPCScanner, logger Logger)
- type ActionType
- type AuthConfig
- type Change
- type Changes
- type Client
- type Clients
- type Commit
- type Config
- type File
- type FileMode
- type GRPCScanner
- type InvalidRepositoryPathError
- type Logger
- type Pipeline
- type PipelineConfig
- type PipelineID
- type PipelineRepository
- type Plugin
- func (p *Plugin) Cleanup()
- func (p *Plugin) DeleteCache() error
- func (p *Plugin) GetCache(commitID string) (*treportproto.ScanResponse, error)
- func (p *Plugin) Scan(ctx context.Context, scanctx *ScanContext) error
- func (p *Plugin) Setup(args []string) error
- func (p *Plugin) StoreCache(commitID string, cache *treportproto.ScanResponse) error
- type PluginConfig
- type PluginExecConfig
- type PluginID
- type PluginVersion
- type PluginVersionDB
- type ProjectConfig
- type Repository
- func (r *Repository) AllCommits(ctx context.Context, cb func(*ScanContext) error) error
- func (r *Repository) AllMergeCommits(ctx context.Context, cb func(*ScanContext) error) error
- func (r *Repository) BaseBranch() (*config.Branch, error)
- func (r *Repository) HeadOnly(ctx context.Context, cb func(*ScanContext) error) error
- func (r *Repository) Sync(ctx context.Context, branch plumbing.ReferenceName) error
- type RepositoryConfig
- type Response
- type ScanContext
- type Scanner
- type ScannerPlugin
- type Signature
- type Snapshot
- type Step
- type StepConfig
- type Strategy
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Handshake = plugin.HandshakeConfig{ ProtocolVersion: 1, MagicCookieKey: "TREPORT_PLUGIN", MagicCookieValue: "treport", } BuiltinPluginNames = []string{ "size", } BuiltinPlugins []*Plugin )
View Source
var (
ErrNoData = fmt.Errorf("data doesn't exist")
)
Functions ¶
func Serve ¶
func Serve(scanner GRPCScanner, logger Logger)
Types ¶
type ActionType ¶
type ActionType int
const ( Deleted ActionType = iota Added Updated )
func (ActionType) String ¶
func (t ActionType) String() string
type AuthConfig ¶
func (*AuthConfig) BasicAuth ¶
func (c *AuthConfig) BasicAuth() *http.BasicAuth
func (*AuthConfig) Password ¶
func (c *AuthConfig) Password() string
func (*AuthConfig) User ¶
func (c *AuthConfig) User() string
type Change ¶
type Change struct { From *File To *File Action ActionType }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Scan ¶
func (c *Client) Scan(ctx context.Context, scanctx *ScanContext) (*treportproto.ScanResponse, error)
type Config ¶
type Config struct { Project ProjectConfig `yaml:"project"` Plugin *PluginConfig `yaml:"plugin"` Pipelines []*PipelineConfig `yaml:"pipelines"` }
func LoadConfig ¶
func (*Config) PluginPath ¶
func (*Config) PluginVersionDB ¶
func (c *Config) PluginVersionDB() (*PluginVersionDB, error)
type GRPCScanner ¶
type GRPCScanner interface {
Scan(*ScanContext) (*Response, error)
}
type InvalidRepositoryPathError ¶
type InvalidRepositoryPathError struct {
Path string
}
func (*InvalidRepositoryPathError) Error ¶
func (e *InvalidRepositoryPathError) Error() string
type Pipeline ¶
type Pipeline struct { ID PipelineID Repos []*PipelineRepository Config *PipelineConfig CachePath string }
type PipelineConfig ¶
type PipelineConfig struct { Name string `yaml:"name"` Desc string `yaml:"desc"` Strategy Strategy `yaml:"strategy"` Repository []*RepositoryConfig `yaml:"repository"` Steps []*StepConfig `yaml:"steps"` }
type PipelineID ¶
type PipelineID string
type PipelineRepository ¶
type PipelineRepository struct { *Repository Steps []*Step CachePath string }
func (*PipelineRepository) Cleanup ¶
func (r *PipelineRepository) Cleanup()
type Plugin ¶
type Plugin struct { Name string Args []string Repo *Repository CachePath string Client *Client // contains filtered or unexported fields }
func (*Plugin) DeleteCache ¶
func (*Plugin) GetCache ¶
func (p *Plugin) GetCache(commitID string) (*treportproto.ScanResponse, error)
func (*Plugin) StoreCache ¶
func (p *Plugin) StoreCache(commitID string, cache *treportproto.ScanResponse) error
type PluginConfig ¶
type PluginConfig struct { Scanner []*RepositoryConfig `yaml:"scanner"` Storer []*RepositoryConfig `yaml:"storer"` }
type PluginExecConfig ¶
type PluginVersion ¶
type PluginVersionDB ¶
type PluginVersionDB struct {
// contains filtered or unexported fields
}
func (*PluginVersionDB) Update ¶
func (db *PluginVersionDB) Update(plg *Plugin) error
type ProjectConfig ¶
type ProjectConfig struct {
Path string `yaml:"path"`
}
func (*ProjectConfig) MountPath ¶
func (c *ProjectConfig) MountPath() string
type Repository ¶
type Repository struct { *git.Repository ID string // contains filtered or unexported fields }
func NewRepository ¶
func NewRepository(ctx context.Context, mountPath string, cfg *RepositoryConfig) (*Repository, error)
func (*Repository) AllCommits ¶
func (r *Repository) AllCommits(ctx context.Context, cb func(*ScanContext) error) error
func (*Repository) AllMergeCommits ¶
func (r *Repository) AllMergeCommits(ctx context.Context, cb func(*ScanContext) error) error
func (*Repository) BaseBranch ¶
func (r *Repository) BaseBranch() (*config.Branch, error)
func (*Repository) HeadOnly ¶
func (r *Repository) HeadOnly(ctx context.Context, cb func(*ScanContext) error) error
func (*Repository) Sync ¶
func (r *Repository) Sync(ctx context.Context, branch plumbing.ReferenceName) error
type RepositoryConfig ¶
type RepositoryConfig struct { Name string `yaml:"name"` Repo string `yaml:"repo"` Path string `yaml:"path"` Branch string `yaml:"branch"` Rev string `yaml:"rev"` Auth *AuthConfig `yaml:"auth"` }
func (*RepositoryConfig) RepoPath ¶
func (c *RepositoryConfig) RepoPath() (string, error)
func (*RepositoryConfig) UnmarshalYAML ¶
func (c *RepositoryConfig) UnmarshalYAML(b []byte) error
type ScanContext ¶
type ScanContext struct { context.Context Commit *Commit Snapshot *Snapshot Changes Changes Repository *Repository Data map[string]*treportproto.ScanResponse // contains filtered or unexported fields }
type ScannerPlugin ¶
type ScannerPlugin struct { plugin.Plugin Scanner GRPCScanner }
func (*ScannerPlugin) GRPCClient ¶
func (p *ScannerPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
func (*ScannerPlugin) GRPCServer ¶
func (p *ScannerPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error
type Step ¶
func (*Step) DeleteCache ¶
type StepConfig ¶
type StepConfig struct {
Plugins []*PluginExecConfig
}
func (*StepConfig) UnmarshalYAML ¶
func (c *StepConfig) UnmarshalYAML(b []byte) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.