* Added graphql API for issues and PRs * enhancements * more cleanup * more enhancements * some final touches * some more cleanup * tweaked threads vars * minor changes * scan the markdown text not plain text * ratelimit handling * added ratelimit handling * lint error fix * refactored the thread review comments chunking * final commit - probably * refactored the rate limit handling * adjusted comments * resolved comments * remove old camel case func * renamed featureflag * resolved martin's comments * updated test cases
40 lines
1.0 KiB
Go
40 lines
1.0 KiB
Go
package feature
|
|
|
|
import "sync/atomic"
|
|
|
|
var (
|
|
ForceSkipBinaries atomic.Bool
|
|
ForceSkipArchives atomic.Bool
|
|
SkipAdditionalRefs atomic.Bool
|
|
EnableAPKHandler atomic.Bool
|
|
UserAgentSuffix AtomicString
|
|
UseSimplifiedGitlabEnumeration atomic.Bool
|
|
UseGitMirror atomic.Bool
|
|
GitlabProjectsPerPage atomic.Int64
|
|
UseGithubGraphQLAPI atomic.Bool // use github graphql api to fetch issues, pr's and comments
|
|
)
|
|
|
|
type AtomicString struct {
|
|
value atomic.Value
|
|
}
|
|
|
|
// Load returns the current value of the atomic string
|
|
func (as *AtomicString) Load() string {
|
|
if v := as.value.Load(); v != nil {
|
|
return v.(string)
|
|
}
|
|
return ""
|
|
}
|
|
|
|
// Store sets the value of the atomic string
|
|
func (as *AtomicString) Store(newValue string) {
|
|
as.value.Store(newValue)
|
|
}
|
|
|
|
// Swap atomically swaps the current string with a new one and returns the old value
|
|
func (as *AtomicString) Swap(newValue string) string {
|
|
oldValue := as.Load()
|
|
as.Store(newValue)
|
|
return oldValue
|
|
}
|