Rename to craban
This commit is contained in:
parent
38767a78d3
commit
ca0bfa2398
217 changed files with 23 additions and 23 deletions
2
server/vendor/github.com/corpix/uarand/.gitignore
generated
vendored
Normal file
2
server/vendor/github.com/corpix/uarand/.gitignore
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/build
|
||||
*~
|
3
server/vendor/github.com/corpix/uarand/.travis.yml
generated
vendored
Normal file
3
server/vendor/github.com/corpix/uarand/.travis.yml
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
language: nix
|
||||
|
||||
script: nix-shell --pure --command "make lint test"
|
24
server/vendor/github.com/corpix/uarand/LICENSE
generated
vendored
Normal file
24
server/vendor/github.com/corpix/uarand/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
This is free and unencumbered software released into the public domain.
|
||||
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
distribute this software, either in source code form or as a compiled
|
||||
binary, for any purpose, commercial or non-commercial, and by any
|
||||
means.
|
||||
|
||||
In jurisdictions that recognize copyright laws, the author or authors
|
||||
of this software dedicate any and all copyright interest in the
|
||||
software to the public domain. We make this dedication for the benefit
|
||||
of the public at large and to the detriment of our heirs and
|
||||
successors. We intend this dedication to be an overt act of
|
||||
relinquishment in perpetuity of all present and future rights to this
|
||||
software under copyright law.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more information, please refer to <http://unlicense.org/>
|
32
server/vendor/github.com/corpix/uarand/Makefile
generated
vendored
Normal file
32
server/vendor/github.com/corpix/uarand/Makefile
generated
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
.DEFAULT_GOAL = all
|
||||
|
||||
version := $(shell git rev-list --count HEAD).$(shell git rev-parse --short HEAD)
|
||||
|
||||
name := uarand
|
||||
package := github.com/corpix/$(name)
|
||||
|
||||
.PHONY: all
|
||||
all:: useragents.go
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
go test -v ./...
|
||||
|
||||
.PHONY: lint
|
||||
lint:
|
||||
.PHONY: lint
|
||||
lint:
|
||||
golangci-lint --color=always \
|
||||
--exclude='uses unkeyed fields' \
|
||||
--exclude='type .* is unused' \
|
||||
--exclude='should merge variable declaration with assignment on next line' \
|
||||
--deadline=120s \
|
||||
run ./...
|
||||
|
||||
.PHONY: check
|
||||
check: lint test
|
||||
|
||||
.PHONY: useragents.go
|
||||
useragents.go:
|
||||
./scripts/fetch-user-agents | ./scripts/generate-useragents-go $(name) > $@
|
||||
go fmt $@
|
38
server/vendor/github.com/corpix/uarand/README.md
generated
vendored
Normal file
38
server/vendor/github.com/corpix/uarand/README.md
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
uarand
|
||||
----------------
|
||||
|
||||
[](https://travis-ci.org/corpix/uarand)
|
||||
|
||||
Random user-agent producer for go.
|
||||
|
||||
## Example
|
||||
|
||||
``` go
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/corpix/uarand"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Println(uarand.GetRandom())
|
||||
}
|
||||
```
|
||||
|
||||
Save it to `snippet.go` and run:
|
||||
|
||||
``` shell
|
||||
go run snippet.go
|
||||
```
|
||||
|
||||
Which should produce something similar to:
|
||||
|
||||
``` text
|
||||
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[Unlicense](https://unlicense.org/)
|
17
server/vendor/github.com/corpix/uarand/shell.nix
generated
vendored
Normal file
17
server/vendor/github.com/corpix/uarand/shell.nix
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
let
|
||||
nixpkgs = builtins.fetchTarball {
|
||||
url = "https://github.com/nixos/nixpkgs/archive/ddf38a8241089d79c3bcd1777781b6438ab88d84.tar.gz";
|
||||
sha256 = "0fjk69mn58h0gjzgxgnkfkhhf1l707bg2cn4823ma9xbjxbhl0ya";
|
||||
};
|
||||
in with import nixpkgs {};
|
||||
stdenv.mkDerivation {
|
||||
name = "nix-shell";
|
||||
buildInputs = [
|
||||
coreutils bashInteractive jq curl gcc git gnumake
|
||||
go golangci-lint cacert openssl
|
||||
];
|
||||
shellHook = ''
|
||||
unset GOPATH
|
||||
export NIX_PATH=nixpkgs=${nixpkgs}
|
||||
'';
|
||||
}
|
63
server/vendor/github.com/corpix/uarand/uarand.go
generated
vendored
Normal file
63
server/vendor/github.com/corpix/uarand/uarand.go
generated
vendored
Normal file
|
@ -0,0 +1,63 @@
|
|||
package uarand
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
// Default is the UARand with default settings.
|
||||
Default = New(
|
||||
rand.New(
|
||||
rand.NewSource(time.Now().UnixNano()),
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
// Randomizer represents some entity which could provide us an entropy.
|
||||
type Randomizer interface {
|
||||
Seed(n int64)
|
||||
Intn(n int) int
|
||||
}
|
||||
|
||||
// UARand describes the user agent randomizer settings.
|
||||
type UARand struct {
|
||||
Randomizer
|
||||
UserAgents []string
|
||||
|
||||
mutex sync.Mutex
|
||||
}
|
||||
|
||||
// GetRandom returns a random user agent from UserAgents slice.
|
||||
func (u *UARand) GetRandom() string {
|
||||
u.mutex.Lock()
|
||||
n := u.Intn(len(u.UserAgents))
|
||||
u.mutex.Unlock()
|
||||
|
||||
return u.UserAgents[n]
|
||||
}
|
||||
|
||||
// GetRandom returns a random user agent from UserAgents slice.
|
||||
// This version is driven by Default configuration.
|
||||
func GetRandom() string {
|
||||
return Default.GetRandom()
|
||||
}
|
||||
|
||||
// New return UserAgent randomizer settings with default user-agents list
|
||||
func New(r Randomizer) *UARand {
|
||||
return &UARand{
|
||||
Randomizer: r,
|
||||
UserAgents: UserAgents,
|
||||
mutex: sync.Mutex{},
|
||||
}
|
||||
}
|
||||
|
||||
// NewWithCustomList return UserAgent randomizer settings with custom user-agents list
|
||||
func NewWithCustomList(userAgents []string) *UARand {
|
||||
return &UARand{
|
||||
Randomizer: rand.New(rand.NewSource(time.Now().UnixNano())),
|
||||
UserAgents: userAgents,
|
||||
mutex: sync.Mutex{},
|
||||
}
|
||||
}
|
1735
server/vendor/github.com/corpix/uarand/useragents.go
generated
vendored
Normal file
1735
server/vendor/github.com/corpix/uarand/useragents.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue