Documentation ¶
Overview ¶
Copyright © 2022 Dane Nelson <apogeesystemsllc@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func InitConfig()
- func InitDatabase()
- func IsRepo(path string) (isRepo bool, err error)
- func IsValidDirectory(basePath string, childPath string, value WatchConfig) (valid bool, err error)
- func StartPoller()
- type CallState
- type CaptureStatus
- type CommitConfig
- type Config
- func (c *Config) CreateDir(path string) (err error)
- func (c *Config) DefaultPath() (path string)
- func (c *Config) Empty()
- func (c *Config) GetDuraConfigHome() (path string)
- func (c *Config) GitRepos() (repos map[string]WatchConfig)
- func (c *Config) Load()
- func (c *Config) LoadFile(filepath string) (err error)
- func (c *Config) Save() (err error)
- func (c *Config) SaveToPath(filename string) (err error)
- func (c *Config) SetUnwatch(path string) (err error)
- func (c *Config) SetWatch(path string, cfg WatchConfig) (err error)
- type DuraConfig
- type GitRepoIter
- type Operation
- type OperationSnapshot
- type RuntimeLock
- func (rl *RuntimeLock) CreateDir(path string) (err error)
- func (rl *RuntimeLock) DefaultPath() (path string)
- func (rl *RuntimeLock) Empty()
- func (rl *RuntimeLock) GetDuraCacheHome() (path string)
- func (rl *RuntimeLock) Load() (err error)
- func (rl *RuntimeLock) LoadFile(filepath string) (err error)
- func (rl *RuntimeLock) Save() (err error)
- func (rl *RuntimeLock) SaveToPath(path string) (err error)
- type WatchConfig
Constants ¶
View Source
const ( YIELD CallState = "Yield" RECURSE = "Recurse" DONE = "Done" )
Variables ¶
View Source
var (
DefSleepSeconds = 5
)
Functions ¶
func InitConfig ¶
func InitConfig()
func InitDatabase ¶
func InitDatabase()
func IsValidDirectory ¶
func IsValidDirectory(basePath string, childPath string, value WatchConfig) (valid bool, err error)
func StartPoller ¶
func StartPoller()
Types ¶
type CaptureStatus ¶
type CaptureStatus struct { DuraBranch string `json:"dura_branch"` CommitHash string `json:"commit_hash"` BaseHash string `json:"base_hash"` }
func Capture ¶
func Capture(path string) (cs *CaptureStatus, err error)
func (*CaptureStatus) Display ¶
func (cs *CaptureStatus) Display() (err error)
type CommitConfig ¶
type Config ¶
type Config struct { Dura DuraConfig `toml:"dura"` Commit CommitConfig `toml:"commit"` Repositories map[string]WatchConfig `toml:"repos" mapstructure:"repos"` }
func (*Config) DefaultPath ¶
func (*Config) GetDuraConfigHome ¶
func (*Config) GitRepos ¶
func (c *Config) GitRepos() (repos map[string]WatchConfig)
func (*Config) SaveToPath ¶
func (*Config) SetUnwatch ¶
type DuraConfig ¶
type DuraConfig struct {
SleepSeconds int `toml:"sleep_seconds" mapstructure:"sleep_seconds"`
}
type GitRepoIter ¶
type GitRepoIter struct {
// contains filtered or unexported fields
}
func NewGitRepoIter ¶
func NewGitRepoIter(config Config) (iter *GitRepoIter)
func (*GitRepoIter) GetNext ¶
func (iter *GitRepoIter) GetNext() (state CallState)
type Operation ¶
type Operation struct {
Snapshot OperationSnapshot `json:"snapshot"`
}
type OperationSnapshot ¶
type OperationSnapshot struct { Repo string `json:"repo"` Op *CaptureStatus `json:"op,omitempty"` Error *string `json:"error,omitempty"` Latency float32 `json:"latency"` }
type RuntimeLock ¶
type RuntimeLock struct {
Pid *uint32 `json:"pid,omitempty" mapstructure:"pid,omitempty"`
}
func (*RuntimeLock) CreateDir ¶
func (rl *RuntimeLock) CreateDir(path string) (err error)
func (*RuntimeLock) DefaultPath ¶
func (rl *RuntimeLock) DefaultPath() (path string)
func (*RuntimeLock) Empty ¶
func (rl *RuntimeLock) Empty()
func (*RuntimeLock) GetDuraCacheHome ¶
func (rl *RuntimeLock) GetDuraCacheHome() (path string)
func (*RuntimeLock) Load ¶
func (rl *RuntimeLock) Load() (err error)
func (*RuntimeLock) LoadFile ¶
func (rl *RuntimeLock) LoadFile(filepath string) (err error)
func (*RuntimeLock) Save ¶
func (rl *RuntimeLock) Save() (err error)
func (*RuntimeLock) SaveToPath ¶
func (rl *RuntimeLock) SaveToPath(path string) (err error)
type WatchConfig ¶
type WatchConfig struct { Include []string `toml:"include" mapstructure:"include,omitempty"` Exclude []string `toml:"exclude" mapstructure:"exclude,omitempty"` MaxDepth int `toml:"max_depth" mapstructure:"max_depth,omitempty"` }
func NewWatchConfig ¶
func NewWatchConfig() (wc *WatchConfig)
Click to show internal directories.
Click to hide internal directories.