aggregator

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const AggregatorLocalAPILevel = "v1"

AggregatorLocalAPILevel the current level of the local file cache. use BaseDir plus this

View Source
const HTTPTimeout = 10

HTTPTimeout timeout in seconds for HTTP operations

Variables

View Source
var ErrCacheLock = errors.New("aggregator cache is locked")

ErrCacheLock Is thrown when aggregator's local cache is locked.

Functions

func FileExists added in v0.0.15

func FileExists(path string) bool

FileExists helper function for checking a file exists

func GetTarBall added in v0.1.1

func GetTarBall(base string, baseURL string, language string, path string) (tar string, err error)

GetTarBall Path of the tarball

Types

type Aggregator

type Aggregator struct {
	Samples Samples
	Online  bool

	Bulk bool
	// contains filtered or unexported fields
}

Aggregator struct representing the sample store. Not really thread safe

func NewAggregator

func NewAggregator(URL string, FilePath string, languages []string, ignoreOS bool, bulk bool) (*Aggregator, error)

NewAggregator Gives you a Aggregator.

func (*Aggregator) GetLanguages

func (a *Aggregator) GetLanguages() []string

GetLanguages gets the base URL used for fetching

func (*Aggregator) GetLocalPath

func (a *Aggregator) GetLocalPath() string

GetLocalPath returns the path local path

func (*Aggregator) GetURL

func (a *Aggregator) GetURL() string

GetURL gets the base URL used for fetching

func (*Aggregator) Update

func (a *Aggregator) Update() error

Update updates the local cache

type Fields

type Fields struct {
	Name         string   `json:"name"`
	Description  string   `json:"description"`
	Categories   []string `json:"categories"`
	Author       string   `json:"author"`
	Date         string   `json:"date"`
	Tag          string   `json:"tag"`
	Dependencies []string `json:"dependencies"`
	OS           []string `json:"os"`
	ReadmeURI    string   `json:"sample_readme_uri"`
	TargetDevice []string `json:"targetDevice"`
	Builder      []string `json:"builder"`
	Toolchain    []string `json:"toolchain"`

	//Not Parsing these out atm
	ProjectOptions   []interface{} `json:"projectOptions"`
	MakeVariables    map[string]interface{}
	IndexerVariables map[string]interface{}
}

Fields type (nested struct in sample type)

type Sample

type Sample struct {
	Path   string `json:"path"`
	SHA    string `json:"sha"`
	Fields Fields `json:"example"`
}

Sample Type

type Samples

type Samples map[string][]Sample

Samples a map containing an array of avaible samples for that language i.e. Samples['cpp"]

Jump to

Keyboard shortcuts

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