Documentation
¶
Index ¶
- Constants
- func GetFiles(dir string) ([]string, error)
- func GetGithubBody(token, url string) (interface{}, error)
- func GetGithubBodyWithCache(token, url string, cache *Cache) (interface{}, error)
- func GetLatestRelease(action string, gitHubToken string) (interface{}, error)
- func GetLatestTag(action string, gitHubToken string) (interface{}, error)
- func GetReleases(action string, gitHubToken string, days *uint) (map[string]interface{}, error)
- func GetStringValue(block *hclwrite.Block, attribute string) string
- func GetVersion(block *hclwrite.Block) string
- func IsOK(rawURL string) (bool, error)
- type Cache
- type CacheEntry
- type ConfigFile
- type Flags
- func (myFlags *Flags) Action(action string) error
- func (myFlags *Flags) GetGHA() []string
- func (myFlags *Flags) GetGithubHash(newModule string, tag string) (string, error)
- func (myFlags *Flags) GetGithubLatestHash(newModule string) (string, string, error)
- func (myFlags *Flags) GetHook() (*string, error)
- func (myFlags *Flags) GetTF() ([]string, error)
- func (myFlags *Flags) GetType(module string) (string, error)
- func (f *Flags) InitializeCache() error
- func (myFlags *Flags) UpdateGHA(file string) error
- func (myFlags *Flags) UpdateGHAS() error
- func (myFlags *Flags) UpdateGithubSource(version string, newModule string) (string, string, error)
- func (myFlags *Flags) UpdateHooks() error
- func (myFlags *Flags) UpdateModule(file string) error
- func (myFlags *Flags) UpdateModules() error
- func (myFlags *Flags) UpdateSource(module string, moduleType string, version string) (string, string, error)
- func (myFlags *Flags) WithSubDir(version string, newModule string, subdir string) (string, string, error)
- type Hook
- type RateLimitError
- type Registry
- type Repo
- type URLFormatError
Constants ¶
const ( ActionSwipe = "swipe" ActionSwot = "swot" ActionSift = "sift" )
const ( PreCommitConfigFile = ".pre-commit-config.yaml" GitHubPrefix = "https://github.com/" FilePermissions = 0666 )
Add constants for repeated values
Variables ¶
This section is empty.
Functions ¶
func GetGithubBody ¶
GetGithubBody fetches data from GitHub API (existing function, keep as-is for compatibility)
func GetGithubBodyWithCache ¶ added in v0.1.14
GetGithubBodyWithCache fetches data from GitHub API with caching support
func GetLatestRelease ¶
func GetLatestTag ¶
func GetReleases ¶
GetReleases fetches releases from GitHub with rate limit handling
func GetVersion ¶
Types ¶
type Cache ¶ added in v0.1.14
type Cache struct {
// contains filtered or unexported fields
}
Cache handles caching of GitHub API responses
func NewCache ¶ added in v0.1.14
NewCache creates a new cache instance ttl is the time-to-live for cached entries (e.g., 24 hours)
func (*Cache) ClearExpired ¶ added in v0.1.14
ClearExpired removes expired cache entries
func (*Cache) Get ¶ added in v0.1.14
Get retrieves a cached response Returns the cached data and true if found and not expired, otherwise nil and false
type CacheEntry ¶ added in v0.1.14
type CacheEntry struct {
Data interface{} `json:"data"`
ExpiresAt time.Time `json:"expires_at"`
URL string `json:"url"`
}
CacheEntry represents a cached API response
type ConfigFile ¶
type Flags ¶
type Flags struct {
// Existing fields
DryRun bool
Update bool
File string
Directory string
GitHubToken string
Stable *uint
Entries []string // For tracking entries
Days *uint // Days parameter
ContinueOnError bool // Continue on error flag
// New cache fields
Cache *Cache
CacheEnabled bool
CacheTTL time.Duration
}
Flags represents command-line flags and configuration
func NewFlags ¶ added in v0.1.14
func NewFlags() *Flags
NewFlags creates a new Flags instance with default cache settings
func (*Flags) GetGithubHash ¶
func (*Flags) GetGithubLatestHash ¶
func (*Flags) InitializeCache ¶ added in v0.1.14
InitializeCache initializes the cache based on flags
func (*Flags) UpdateGHAS ¶
func (*Flags) UpdateGithubSource ¶
func (*Flags) UpdateHooks ¶
func (*Flags) UpdateModule ¶
func (*Flags) UpdateModules ¶
func (*Flags) UpdateSource ¶
type Hook ¶
type Hook struct {
ID string `yaml:"id"`
Name string `yaml:"name,omitempty"`
Entry string `yaml:"entry,omitempty"`
Language string `yaml:"language,omitempty"`
Files string `yaml:"files,omitempty"`
Exclude string `yaml:"exclude,omitempty"`
Types []string `yaml:"types,omitempty"`
TypesOr []string `yaml:"types_or,omitempty"`
ExcludeTypes []string `yaml:"exclude_types,omitempty"`
AlwaysRun *bool `yaml:"always_run,omitempty"`
FailFast *bool `yaml:"fail_fast,omitempty"`
Verbose *bool `yaml:"verbose,omitempty"`
PassFilenames *bool `yaml:"pass_filenames,omitempty"`
RequireSerial *bool `yaml:"require_serial,omitempty"`
Description string `yaml:"description,omitempty"`
LanguageVersion string `yaml:"language_version,omitempty"`
MinimumPrecommitVersion string `yaml:"minimum_pre_commit_version,omitempty"`
Args []string `yaml:"args,omitempty"`
Stages []string `yaml:"stages,omitempty"`
}
type RateLimitError ¶ added in v0.1.14
RateLimitError represents a rate limit error
func (*RateLimitError) Error ¶ added in v0.1.14
func (e *RateLimitError) Error() string
type URLFormatError ¶ added in v0.1.10
type URLFormatError struct {
// contains filtered or unexported fields
}
func (URLFormatError) Error ¶ added in v0.1.10
func (e URLFormatError) Error() string