session

package
v0.0.0-...-75d66c5 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2017 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Overview

Copyright © 2017 Erno Rigo <erno@rigo.info>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Copyright © 2017 Erno Rigo <erno@rigo.info>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Copyright © 2017 Erno Rigo <erno@rigo.info>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindRoot

func FindRoot(path string) (root string)

calculates longest non-wildcard prefix for a path based on github.com/gobwas/glob/syntax/lexer

Types

type FileContentLoader

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

func NewFileContentLoader

func NewFileContentLoader() *FileContentLoader

func (*FileContentLoader) Concurrency

func (loader *FileContentLoader) Concurrency() int

func (*FileContentLoader) Name

func (loader *FileContentLoader) Name() string

func (*FileContentLoader) Process

func (loader *FileContentLoader) Process(item interface{})

type Filewalker

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

func NewFilewalker

func NewFilewalker() *Filewalker

collect (local) file list into current session based on configuration

func (*Filewalker) Abort

func (fw *Filewalker) Abort()

func (*Filewalker) Generate

func (fw *Filewalker) Generate()

collect file Items into session

func (*Filewalker) Name

func (fw *Filewalker) Name() string

func (*Filewalker) Next

func (fw *Filewalker) Next() interface{}

type Hasher

type Hasher struct {
}

func NewHasher

func NewHasher() *Hasher

func (*Hasher) Concurrency

func (hasher *Hasher) Concurrency() int

func (*Hasher) Name

func (hasher *Hasher) Name() string

func (*Hasher) Process

func (hasher *Hasher) Process(item interface{})

type IncEx

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

func NewIncEx

func NewIncEx(include []string, exclude []string) *IncEx

Include and Exclude files by glob pattern lists

func (*IncEx) Includes

func (incex *IncEx) Includes(path string) bool

determines if the given path would be allowed by include and exclude rules returns true for included paths, false otherwise

type Pipeline

type Pipeline struct {
}

func NewPipeline

func NewPipeline() *Pipeline

func (*Pipeline) Run

func (pl *Pipeline) Run() *Session

type Session

type Session struct {
	Meta  SessionMeta    `json:"meta"`
	Items []*SessionItem `json:"items"`
}

func NewSession

func NewSession() *Session

func (*Session) AddItem

func (sess *Session) AddItem(item *SessionItem)

func (*Session) Concurrency

func (sess *Session) Concurrency() int

func (*Session) Name

func (sess *Session) Name() string

func (*Session) Process

func (sess *Session) Process(item interface{})

type SessionItem

type SessionItem struct {
	Id    url.URL                `json:"id"`
	Attrs map[string]interface{} `json:"attrs"`
}

func NewSessionItem

func NewSessionItem(id url.URL) *SessionItem

func NewSessionItemMap

func NewSessionItemMap(id url.URL, attrs map[string]interface{}) *SessionItem

func (*SessionItem) GetAttr

func (item *SessionItem) GetAttr(key string) interface{}

func (*SessionItem) GetAttrString

func (item *SessionItem) GetAttrString(key string) string

func (*SessionItem) GetAttrUint64

func (item *SessionItem) GetAttrUint64(key string) uint64

func (*SessionItem) HasAttr

func (item *SessionItem) HasAttr(key string) bool

func (*SessionItem) SetAttr

func (item *SessionItem) SetAttr(key string, value interface{})

func (*SessionItem) SetAttrMap

func (item *SessionItem) SetAttrMap(attrs map[string]interface{})

func (*SessionItem) String

func (item *SessionItem) String() string

type SessionMeta

type SessionMeta struct {
	UUID  uuid.UUID `json:"uuid"`
	Time  time.Time `json:"time"`
	Items int64
}

type Stater

type Stater struct {
}

func NewStater

func NewStater() *Stater

func (*Stater) Concurrency

func (stater *Stater) Concurrency() int

func (*Stater) Name

func (stater *Stater) Name() string

func (*Stater) Process

func (stater *Stater) Process(item interface{})

Jump to

Keyboard shortcuts

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