gosrc

package
v0.0.0-...-c7fb358 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2013 License: BSD-2-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FlagGo uint64 = 1 << 16

Functions

func Deps

func Deps(src *Src, pkg *Pkg)

func LoadHtmlDoc

func LoadHtmlDoc(path string, all bool) ([]byte, error)

func Scan

func Scan(p *Pkg) error

Types

type Code

type Code struct {
	Info   *Info   `json:",omitempty"`
	Result *Result `json:",omitempty"`
}

type Detail

type Detail struct {
	Name string
	Src  Code `json:",omitempty"`
	Test Code `json:",omitempty"`
	Uses []ws.Id
}

func (*Detail) AddUse

func (d *Detail) AddUse(id ws.Id)

type File

type File struct {
	Id   ws.Id
	Name string
	Err  error
}

type Import

type Import struct {
	Path string
	Id   ws.Id
}

type Info

type Info struct {
	Time    int64
	Files   []File
	Imports []Import
}

func (*Info) AddFile

func (nfo *Info) AddFile(id ws.Id, name string)

func (*Info) AddImport

func (nfo *Info) AddImport(path string)

func (*Info) Copy

func (nfo *Info) Copy() *Info

func (*Info) File

func (nfo *Info) File(id ws.Id) *File

func (*Info) Import

func (nfo *Info) Import(path string) *Import

func (*Info) Merge

func (nfo *Info) Merge(old *Info)

type Pkg

type Pkg struct {
	sync.Mutex
	Id   ws.Id
	Flag PkgFlag
	Pkgs []*Pkg

	// Found
	Res *ws.Res
	Dir string

	// Valid
	Path string

	// Scanned
	Detail
}

type PkgFlag

type PkgFlag uint64
const (
	Working PkgFlag
	Recursing
	Watching
	MissingDeps
)

type Report

type Report struct {
	Id   ws.Id
	Dir  string
	Path string
	Detail
}

func NewReport

func NewReport(pkg *Pkg) *Report

func (*Report) String

func (r *Report) String() string

type Result

type Result struct {
	Mode   string
	Time   int64
	Err    error
	Stdout string `json:",omitempty"`
	Stderr string `json:",omitempty"`
}

func Install

func Install(pkg *Pkg) *Result

func Test

func Test(pkg *Pkg) *Result

type Src

type Src struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New() *Src

func (*Src) AllReports

func (s *Src) AllReports() []*Report

func (*Src) Filter

func (s *Src) Filter(r *ws.Res) bool

func (*Src) Find

func (s *Src) Find(path string) *Pkg

func (*Src) Handle

func (s *Src) Handle(op ws.Op, r *ws.Res)

func (*Src) Init

func (s *Src) Init()

func (*Src) Pkg

func (s *Src) Pkg(id ws.Id) *Pkg

func (*Src) Run

func (s *Src) Run()

func (*Src) SignalReports

func (s *Src) SignalReports(f func(*Report))

func (*Src) WorkOn

func (s *Src) WorkOn(path string) error

Jump to

Keyboard shortcuts

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