app

package
v0.0.0-...-160fd46 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2018 License: MIT Imports: 23 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// RetryTaskKey -
	RetryTaskKey ContextType = "Retry-Task-Key"
	// SearchTaskKey -
	SearchTaskKey ContextType = "Search-Task-Key"
	// ListTaskKey -
	ListTaskKey ContextType = "List-Task-Key"
	// IndexTaskKey -
	IndexTaskKey ContextType = "Index-Task-Key"

	// RepoDir -
	RepoDir = "repo-"
	// ReposDir -
	ReposDir = "repos/"
	// CacheDir -
	CacheDir = "cache/"
	// ReposJSON -
	ReposJSON = "repos.json"
	// InfoJSON -
	InfoJSON = "info.json"
)

Variables

This section is empty.

Functions

func IndexTaskFunc

func IndexTaskFunc(ctx context.Context) error

IndexTaskFunc -

func ListTaskFunc

func ListTaskFunc(ctx context.Context) error

ListTaskFunc -

func NewDetector

func NewDetector() *cobra.Command

NewDetector creates a *cobra.Command object with default parameters.

func NewIndexTaskContext

func NewIndexTaskContext(info *IndexTaskInfo) context.Context

NewIndexTaskContext -

func NewListTaskContext

func NewListTaskContext(info *ListTaskInfo) context.Context

NewListTaskContext -

func NewRetryTaskContext

func NewRetryTaskContext(info *RetryTaskInfo) context.Context

NewRetryTaskContext -

func NewSearchTaskContext

func NewSearchTaskContext(info *SearchTaskInfo) context.Context

NewSearchTaskContext -

func Run

Run runs the detector.

func SearchTaskFunc

func SearchTaskFunc(ctx context.Context) (err error)

SearchTaskFunc -

Types

type ContextType

type ContextType string

ContextType -

type Dep

type Dep struct {
	URL      string    `json:"url"`
	Type     string    `json:"type"`
	Conf     conf.File `json:"conf"`
	Lock     lock.File `json:"lock"`
	Direct   []string  `json:"direct"`
	Indirect []string  `json:"indirect"`
}

Dep -

type DownloadTask

type DownloadTask struct {
	Type DownloadType
	Conf string
	Lock string
}

DownloadTask -

type DownloadType

type DownloadType int8

DownloadType -

const (
	// IgnoreType -
	IgnoreType DownloadType = iota
	// NoVendorType -
	NoVendorType
	// NotSupportType -
	NotSupportType
	// AgainType -
	AgainType
	// VendorType -
	VendorType
)

type IndexTaskInfo

type IndexTaskInfo struct {
	CacheDir string
	ReposDir string

	Info *sync.Map
}

IndexTaskInfo -

type Info

type Info struct {
	URL    string `yaml:"url"`
	Type   string `yaml:"type"`
	Status string `yaml:"status"`
}

Info -

type ListTaskInfo

type ListTaskInfo struct {
	Dir   string
	URL   string
	Owner string
	Repo  string
	Path  string

	Info *sync.Map

	GPool pool.Pool
}

ListTaskInfo -

type RetryTask

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

RetryTask -

func NewRetryTask

func NewRetryTask(ctx context.Context, task scheduler.Task) *RetryTask

NewRetryTask -

func (*RetryTask) Do

func (rt *RetryTask) Do(ctx context.Context) (err error)

Do -

type RetryTaskInfo

type RetryTaskInfo struct {
	Times int
}

RetryTaskInfo -

type SearchTaskInfo

type SearchTaskInfo struct {
	RepoDir  string
	Language string
	Pushed   time.Duration
	Min      int
	Max      int

	GPool pool.Pool
}

SearchTaskInfo -

type Source

type Source struct {
	URL  string `json:"url"`
	Type string `json:"type"`
	Conf []byte `json:"conf,omitempty"`
	Lock []byte `json:"lock"`
}

Source -

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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