repo stringlengths 6 47 | file_url stringlengths 77 269 | file_path stringlengths 5 186 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-07 08:35:43 2026-01-07 08:55:24 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
hudl/fargo | https://github.com/hudl/fargo/blob/3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd/example_appupdate_test.go | example_appupdate_test.go | package fargo_test
// MIT Licensed (see README.md) - Copyright (c) 2013 Hudl <@Hudl>
import (
"fmt"
"time"
"github.com/hudl/fargo"
)
func ExampleEurekaConnection_ScheduleAppUpdates() {
e := makeConnection()
done := make(chan struct{})
time.AfterFunc(2*time.Minute, func() {
close(done)
})
name := "my_app"
... | go | MIT | 3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd | 2026-01-07T09:45:44.949549Z | false |
hudl/fargo | https://github.com/hudl/fargo/blob/3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd/rpc.go | rpc.go | package fargo
// MIT Licensed (see README.md) - Copyright (c) 2013 Hudl <@Hudl>
import (
"bytes"
"io/ioutil"
"net"
"net/http"
"net/url"
"time"
)
var HttpClient = &http.Client{
Transport: transport,
Timeout: 30 * time.Second,
}
var transport = &http.Transport{
Dial: (&net.Dialer{
Timeout: 5 * time.Secon... | go | MIT | 3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd | 2026-01-07T09:45:44.949549Z | false |
hudl/fargo | https://github.com/hudl/fargo/blob/3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd/errors_test.go | errors_test.go | package fargo
// MIT Licensed (see README.md) - Copyright (c) 2013 Hudl <@Hudl>
import (
"errors"
"strconv"
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestHTTPResponseStatusCode(t *testing.T) {
Convey("An nil error should have no HTTP status code", t, func() {
_, present := HTTPResponseSta... | go | MIT | 3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd | 2026-01-07T09:45:44.949549Z | false |
hudl/fargo | https://github.com/hudl/fargo/blob/3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd/example_common_test.go | example_common_test.go | package fargo_test
// MIT Licensed (see README.md) - Copyright (c) 2013 Hudl <@Hudl>
import "github.com/hudl/fargo"
func makeConnection() fargo.EurekaConnection {
var c fargo.Config
c.Eureka.ServiceUrls = []string{"http://172.17.0.2:8080/eureka/v2"}
c.Eureka.ConnectTimeoutSeconds = 10
c.Eureka.PollIntervalSecond... | go | MIT | 3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd | 2026-01-07T09:45:44.949549Z | false |
hudl/fargo | https://github.com/hudl/fargo/blob/3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd/struct.go | struct.go | package fargo
// MIT Licensed (see README.md) - Copyright (c) 2013 Hudl <@Hudl>
import (
"time"
)
// EurekaURLSlugs is a map of resource names->Eureka URLs.
var EurekaURLSlugs = map[string]string{
"Apps": "apps",
"Instances": "instances",
"InstancesByVIPAddress": "v... | go | MIT | 3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd | 2026-01-07T09:45:44.949549Z | false |
hudl/fargo | https://github.com/hudl/fargo/blob/3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd/example_instancesetsource_test.go | example_instancesetsource_test.go | package fargo_test
// MIT Licensed (see README.md) - Copyright (c) 2013 Hudl <@Hudl>
import (
"fmt"
"time"
"github.com/hudl/fargo"
)
func ExampleInstanceSetSource_Latest_outcomes() {
e := makeConnection()
vipAddress := "my_vip"
source, err := e.NewInstanceSetSourceForVIPAddress(vipAddress, false, false, fargo... | go | MIT | 3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd | 2026-01-07T09:45:44.949549Z | false |
hudl/fargo | https://github.com/hudl/fargo/blob/3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd/errors.go | errors.go | package fargo
// MIT Licensed (see README.md) - Copyright (c) 2013 Hudl <@Hudl>
import (
"fmt"
)
type unsuccessfulHTTPResponse struct {
statusCode int
messagePrefix string
}
func (u *unsuccessfulHTTPResponse) Error() string {
if len(u.messagePrefix) > 0 {
return fmt.Sprint(u.messagePrefix, ", rcode = ", u.... | go | MIT | 3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd | 2026-01-07T09:45:44.949549Z | false |
hudl/fargo | https://github.com/hudl/fargo/blob/3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd/rpc_test.go | rpc_test.go | package fargo
import (
"fmt"
"net/http"
"net/http/httptest"
"testing"
. "github.com/smartystreets/goconvey/convey"
)
type roundtripper struct {
TripCount int
}
func (r *roundtripper) RoundTrip(req *http.Request) (*http.Response, error) {
r.TripCount++
return http.DefaultTransport.RoundTrip(req)
}
func Test... | go | MIT | 3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd | 2026-01-07T09:45:44.949549Z | false |
hudl/fargo | https://github.com/hudl/fargo/blob/3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd/config.go | config.go | package fargo
// MIT Licensed (see README.md) - Copyright (c) 2013 Hudl <@Hudl>
import (
"gopkg.in/gcfg.v1"
)
// Config is a base struct to be read by code.google.com/p/gcfg
type Config struct {
AWS aws
Eureka eureka
}
type aws struct {
AccessKeyID string
SecretAccessKey string
// zones if running in A... | go | MIT | 3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd | 2026-01-07T09:45:44.949549Z | false |
hudl/fargo | https://github.com/hudl/fargo/blob/3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd/metadata.go | metadata.go | package fargo
// MIT Licensed (see README.md) - Copyright (c) 2013 Hudl <@Hudl>
import (
"encoding/json"
"fmt"
x2j "github.com/clbanning/mxj/x2j-wrapper"
)
// ParseAllMetadata iterates through all instances in an application
func (a *Application) ParseAllMetadata() error {
for _, instance := range a.Instances {... | go | MIT | 3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd | 2026-01-07T09:45:44.949549Z | false |
hudl/fargo | https://github.com/hudl/fargo/blob/3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd/connection.go | connection.go | package fargo
// MIT Licensed (see README.md) - Copyright (c) 2013 Hudl <@Hudl>
import (
"math/rand"
"sync"
"time"
)
func init() {
rand.Seed(time.Now().UnixNano())
}
// SelectServiceURL gets a eureka instance based on the connection's load
// balancing scheme.
// TODO: Make this not just pick a random one.
func... | go | MIT | 3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd | 2026-01-07T09:45:44.949549Z | false |
hudl/fargo | https://github.com/hudl/fargo/blob/3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd/net.go | net.go | package fargo
// MIT Licensed (see README.md) - Copyright (c) 2013 Hudl <@Hudl>
import (
"encoding/json"
"encoding/xml"
"errors"
"fmt"
"math/rand"
"net/http"
"strings"
"sync"
"time"
)
func (e *EurekaConnection) generateURL(slugs ...string) string {
return strings.Join(append([]string{e.SelectServiceURL()},... | go | MIT | 3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd | 2026-01-07T09:45:44.949549Z | false |
hudl/fargo | https://github.com/hudl/fargo/blob/3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd/marshal.go | marshal.go | package fargo
// MIT Licensed (see README.md) - Copyright (c) 2013 Hudl <@Hudl>
import (
"encoding/json"
"encoding/xml"
"fmt"
"io"
"strconv"
)
func intFromJSONNumberOrString(jv interface{}, description string) (int, error) {
switch v := jv.(type) {
case float64:
return int(v), nil
case string:
n, err := ... | go | MIT | 3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd | 2026-01-07T09:45:44.949549Z | false |
hudl/fargo | https://github.com/hudl/fargo/blob/3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd/log.go | log.go | package fargo
// MIT Licensed (see README.md) - Copyright (c) 2013 Hudl <@Hudl>
import (
"github.com/op/go-logging"
)
var log = logging.MustGetLogger("fargo")
var metadataLog = logging.MustGetLogger("fargo.metadata")
var marshalLog = logging.MustGetLogger("fargo.marshal")
func init() {
logging.SetLevel(logging.WA... | go | MIT | 3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd | 2026-01-07T09:45:44.949549Z | false |
hudl/fargo | https://github.com/hudl/fargo/blob/3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd/net_test.go | net_test.go | package fargo
// MIT Licensed (see README.md) - Copyright (c) 2013 Hudl <@Hudl>
import (
"math/rand"
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func instancePredicateFrom(t *testing.T, opts ...InstanceQueryOption) func(*Instance) bool {
var mergedOptions instanceQueryOptions
for _, o := range opt... | go | MIT | 3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd | 2026-01-07T09:45:44.949549Z | false |
hudl/fargo | https://github.com/hudl/fargo/blob/3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd/dns_discover_test.go | dns_discover_test.go | package fargo
// MIT Licensed (see README.md) - Copyright (c) 2013 Hudl <@Hudl>
import (
"testing"
"time"
. "github.com/smartystreets/goconvey/convey"
)
func TestGetNXDomain(t *testing.T) {
Convey("Given nonexistent domain nxd.local.", t, func() {
resp, _, err := findTXT("nxd.local.")
So(err, ShouldNotBeNil... | go | MIT | 3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd | 2026-01-07T09:45:44.949549Z | false |
hudl/fargo | https://github.com/hudl/fargo/blob/3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd/example_vipupdate_test.go | example_vipupdate_test.go | package fargo_test
// MIT Licensed (see README.md) - Copyright (c) 2013 Hudl <@Hudl>
import (
"context"
"fmt"
"time"
"github.com/hudl/fargo"
)
func ExampleEurekaConnection_ScheduleVIPAddressUpdates_manual() {
e := makeConnection()
done := make(chan struct{})
time.AfterFunc(2*time.Minute, func() {
close(don... | go | MIT | 3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd | 2026-01-07T09:45:44.949549Z | false |
hudl/fargo | https://github.com/hudl/fargo/blob/3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd/dns_discover.go | dns_discover.go | package fargo
// MIT Licensed (see README.md) - Copyright (c) 2013 Hudl <@Hudl>
import (
"fmt"
"time"
"github.com/cenkalti/backoff/v4"
"github.com/franela/goreq"
"github.com/miekg/dns"
)
const azURL = "http://169.254.169.254/latest/meta-data/placement/availability-zone"
var ErrNotInAWS = fmt.Errorf("Not in AW... | go | MIT | 3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd | 2026-01-07T09:45:44.949549Z | false |
hudl/fargo | https://github.com/hudl/fargo/blob/3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd/tests/marshal_test.go | tests/marshal_test.go | package fargo_test
// MIT Licensed (see README.md) - Copyright (c) 2013 Hudl <@Hudl>
import (
"bytes"
"encoding/json"
"encoding/xml"
"fmt"
"io/ioutil"
"testing"
"github.com/hudl/fargo"
. "github.com/smartystreets/goconvey/convey"
)
func TestJsonMarshal(t *testing.T) {
for _, f := range []string{"apps-sampl... | go | MIT | 3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd | 2026-01-07T09:45:44.949549Z | false |
hudl/fargo | https://github.com/hudl/fargo/blob/3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd/tests/instance_test.go | tests/instance_test.go | package fargo_test
// MIT Licensed (see README.md)
import (
"fmt"
"testing"
"github.com/hudl/fargo"
. "github.com/smartystreets/goconvey/convey"
)
func TestInstanceID(t *testing.T) {
i := fargo.Instance{
HostName: "i-6543",
Port: 9090,
App: "TESTAPP",
IPAddr: ... | go | MIT | 3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd | 2026-01-07T09:45:44.949549Z | false |
hudl/fargo | https://github.com/hudl/fargo/blob/3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd/tests/net_test.go | tests/net_test.go | package fargo_test
// MIT Licensed (see README.md) - Copyright (c) 2013 Hudl <@Hudl>
import (
"fmt"
"net/http"
"sync"
"testing"
"time"
"github.com/hudl/fargo"
. "github.com/smartystreets/goconvey/convey"
)
func shouldNotBearAnHTTPStatusCode(actual interface{}, expected ...interface{}) string {
if code, pres... | go | MIT | 3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd | 2026-01-07T09:45:44.949549Z | false |
hudl/fargo | https://github.com/hudl/fargo/blob/3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd/tests/config_test.go | tests/config_test.go | package fargo_test
// MIT Licensed (see README.md) - Copyright (c) 2013 Hudl <@Hudl>
import (
"github.com/hudl/fargo"
. "github.com/smartystreets/goconvey/convey"
"testing"
)
func TestConfigs(t *testing.T) {
Convey("Reading a blank config to test defaults.", t, func() {
conf, err := fargo.ReadConfig("./config_... | go | MIT | 3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd | 2026-01-07T09:45:44.949549Z | false |
hudl/fargo | https://github.com/hudl/fargo/blob/3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd/tests/metadata_test.go | tests/metadata_test.go | package fargo_test
// MIT Licensed (see README.md) - Copyright (c) 2013 Hudl <@Hudl>
import (
"encoding/xml"
"github.com/hudl/fargo"
. "github.com/smartystreets/goconvey/convey"
"strconv"
"testing"
)
func TestGetInt(t *testing.T) {
Convey("Given an instance", t, func() {
instance := new(fargo.Instance)
Con... | go | MIT | 3eb9752cff0b65fbecf3ea04d7acd8f55a669fcd | 2026-01-07T09:45:44.949549Z | false |
olahol/go-imageupload | https://github.com/olahol/go-imageupload/blob/9b3f98f8b737957f47801eed00e99bcc2ba50fba/imageupload.go | imageupload.go | // Gracefully handle image uploading and thumbnail creation.
package imageupload
import (
"bytes"
"encoding/base64"
"errors"
"fmt"
"github.com/nfnt/resize"
"image"
_ "image/gif"
"image/jpeg"
"image/png"
"io/ioutil"
"net/http"
"strconv"
)
type Image struct {
Filename string
ContentType string
Data ... | go | BSD-2-Clause | 9b3f98f8b737957f47801eed00e99bcc2ba50fba | 2026-01-07T09:45:45.578734Z | false |
olahol/go-imageupload | https://github.com/olahol/go-imageupload/blob/9b3f98f8b737957f47801eed00e99bcc2ba50fba/examples/save/main.go | examples/save/main.go | package main
import (
"fmt"
"net/http"
"time"
"github.com/olahol/go-imageupload"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "index.html")
})
http.HandleFunc("/upload", func(w http.ResponseWriter, r *http.Request) {
if r.Method != "POST" {
h... | go | BSD-2-Clause | 9b3f98f8b737957f47801eed00e99bcc2ba50fba | 2026-01-07T09:45:45.578734Z | false |
olahol/go-imageupload | https://github.com/olahol/go-imageupload/blob/9b3f98f8b737957f47801eed00e99bcc2ba50fba/examples/thumbnailer/main.go | examples/thumbnailer/main.go | package main
import (
"net/http"
"github.com/olahol/go-imageupload"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "index.html")
})
http.HandleFunc("/upload", func(w http.ResponseWriter, r *http.Request) {
if r.Method != "POST" {
http.NotFound(w,... | go | BSD-2-Clause | 9b3f98f8b737957f47801eed00e99bcc2ba50fba | 2026-01-07T09:45:45.578734Z | false |
olahol/go-imageupload | https://github.com/olahol/go-imageupload/blob/9b3f98f8b737957f47801eed00e99bcc2ba50fba/examples/simple/main.go | examples/simple/main.go | package main
import (
"net/http"
"github.com/olahol/go-imageupload"
)
var currentImage *imageupload.Image
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "index.html")
})
http.HandleFunc("/image", func(w http.ResponseWriter, r *http.Request) {
if curr... | go | BSD-2-Clause | 9b3f98f8b737957f47801eed00e99bcc2ba50fba | 2026-01-07T09:45:45.578734Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/work/main.go | work/main.go | package main
import (
"context"
"fmt"
"github.com/rs/zerolog"
"github.com/test-instructor/yangfan/hrp"
"github.com/test-instructor/yangfan/hrp/pkg/boomer"
"github.com/test-instructor/yangfan/server/core"
"github.com/test-instructor/yangfan/server/global"
"github.com/test-instructor/yangfan/server/grpc/client"
... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/proto/tools/install_grpc.pb.go | proto/tools/install_grpc.pb.go | // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v4.23.0--rc2
// source: install.proto
package tools
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// T... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/proto/tools/install.pb.go | proto/tools/install.pb.go | // Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v4.23.0--rc2
// source: install.proto
package tools
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "syn... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/proto/run/run.pb.go | proto/run/run.pb.go | // Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.30.0
// protoc v3.21.2
// source: run.proto
package run
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/proto/run/run_grpc.pb.go | proto/run/run_grpc.pb.go | // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.21.2
// source: run.proto
package run
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a co... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/proto/master/master.pb.go | proto/master/master.pb.go | // Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v4.23.0--rc2
// source: master.proto
package master
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "syn... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | true |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/proto/master/master_grpc.pb.go | proto/master/master_grpc.pb.go | // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v4.23.0--rc2
// source: master.proto
package master
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// T... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/loader.go | parsing/hrp/loader.go | package hrp
import (
"io/fs"
"os"
"path/filepath"
"strings"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
)
func LoadTestCases(iTestCases ...ITestCase) ([]*TestCase, error) {
testCases := make([]*TestCase, 0)
// 遍历传入的ITestCase接口切片,处理每个测试用例。
for _, iTestCase := range iTestCases {
// 如果当前ITestCase是*Te... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/parameters.go | parsing/hrp/parameters.go | package hrp
import (
"math/rand"
"reflect"
"strings"
"sync"
"time"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
)
type TParamsConfig struct {
PickOrder iteratorPickOrder `json:"pick_order,omitempty" yaml:"pick_order,omitempty"` // overall pick-order strategy
Strategies map[string]iteratorS... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/parser.go | parsing/hrp/parser.go | package hrp
import (
builtinJSON "encoding/json"
"fmt"
"net/url"
"path"
"reflect"
"regexp"
"strconv"
"strings"
"github.com/httprunner/funplugin"
"github.com/httprunner/funplugin/shared"
"github.com/maja42/goval"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
"github.com/test-instructor/yangfan/par... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/step_transaction.go | parsing/hrp/step_transaction.go | package hrp
import (
"fmt"
"time"
"github.com/rs/zerolog/log"
)
type Transaction struct {
Name string `json:"name" yaml:"name"`
Type transactionType `json:"type" yaml:"type"`
}
type transactionType string
const (
transactionStart transactionType = "start"
transactionEnd transactionType = "end"
)
... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/runner_test.go | parsing/hrp/runner_test.go | package hrp
import (
"io/ioutil"
"os"
"path/filepath"
"testing"
"time"
"github.com/rs/zerolog/log"
"github.com/stretchr/testify/assert"
"github.com/test-instructor/yangfan/parsing/hrp/internal/code"
)
func buildHashicorpGoPlugin() {
log.Info().Msg("[init] build hashicorp go plugin")
err := BuildPlugin(tmpl... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/summary.go | parsing/hrp/summary.go | package hrp
import (
"bufio"
_ "embed"
"fmt"
"html/template"
"os"
"path/filepath"
"runtime"
"time"
"github.com/rs/zerolog/log"
"github.com/test-instructor/yangfan/parsing/hrp/internal/builtin"
"github.com/test-instructor/yangfan/parsing/hrp/internal/env"
"github.com/test-instructor/yangfan/parsing/hrp/in... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/response.go | parsing/hrp/response.go | package hrp
import (
"bytes"
builtinJSON "encoding/json"
"fmt"
"io"
"net/http"
"regexp"
"strings"
"testing"
"github.com/jmespath/go-jmespath"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
"github.com/test-instructor/yangfan/parsing/hrp/internal/builtin"
"github.com/test-instructor/yangfan/parsing/... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/step_request.go | parsing/hrp/step_request.go | package hrp
import (
"bytes"
"compress/gzip"
"compress/zlib"
"crypto/tls"
"fmt"
"io"
"net/http"
"net/http/httputil"
"net/url"
"os"
"strconv"
"strings"
"time"
"github.com/andybalholm/brotli"
"github.com/fatih/color"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
"github.com/test-instructor/yang... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | true |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/step_mobile_ui_test.go | parsing/hrp/step_mobile_ui_test.go | //go:build localtest
package hrp
import (
"testing"
"github.com/test-instructor/yangfan/parsing/hrp/pkg/uixt"
)
func TestIOSSettingsAction(t *testing.T) {
testCase := &TestCase{
Config: NewConfig("ios ui action on Settings").
SetIOS(uixt.WithWDAPort(8700), uixt.WithWDAMjpegPort(8800)),
TestSteps: []IStep{... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/boomer.go | parsing/hrp/boomer.go | package hrp
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"sync"
"time"
"github.com/httprunner/funplugin"
"github.com/rs/zerolog/log"
"golang.org/x/net/context"
"github.com/test-instructor/yangfan/parsing/hrp/internal/builtin"
"github.com/test-instructor/yangfan/parsing/hrp/internal/code"
"g... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/step_testcase.go | parsing/hrp/step_testcase.go | package hrp
import (
"fmt"
"time"
"github.com/jinzhu/copier"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
)
// StepTestCaseWithOptionalArgs implements IStep interface.
type StepTestCaseWithOptionalArgs struct {
step *TStep
}
// TeardownHook adds a teardown hook for current teststep.
func (s *StepTestCa... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/step_mobile_ui.go | parsing/hrp/step_mobile_ui.go | package hrp
import (
"fmt"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
"github.com/test-instructor/yangfan/parsing/hrp/internal/builtin"
"github.com/test-instructor/yangfan/parsing/hrp/internal/code"
"github.com/test-instructor/yangfan/parsing/hrp/pkg/uixt"
)
type MobileStep struct {
Serial ... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/convert.go | parsing/hrp/convert.go | package hrp
| go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/config.go | parsing/hrp/config.go | package hrp
import (
"reflect"
"time"
"github.com/test-instructor/yangfan/parsing/hrp/internal/builtin"
"github.com/test-instructor/yangfan/parsing/hrp/pkg/uixt"
)
// NewConfig returns a new constructed testcase config with specified testcase name.
func NewConfig(name string) *TConfig {
return &TConfig{
Name:... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/step_rendezvous.go | parsing/hrp/step_rendezvous.go | package hrp
import (
"sync"
"sync/atomic"
"time"
"github.com/rs/zerolog/log"
)
// StepRendezvous implements IStep interface.
type StepRendezvous struct {
step *TStep
}
func (s *StepRendezvous) Name() string {
if s.step.Name != "" {
return s.step.Name
}
return s.step.Rendezvous.Name
}
func (s *StepRendezv... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/testcase_test.go | parsing/hrp/testcase_test.go | package hrp
import (
"path/filepath"
"testing"
"github.com/stretchr/testify/assert"
"github.com/test-instructor/yangfan/parsing/hrp/internal/builtin"
)
const (
hrpExamplesDir = "../examples/hrp"
)
// tmpl returns template file path
func tmpl(relativePath string) string {
return filepath.Join("internal/scaffo... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/build.go | parsing/hrp/build.go | package hrp
import (
"bufio"
_ "embed"
"fmt"
"html/template"
"os"
"path/filepath"
"regexp"
"strings"
"github.com/httprunner/funplugin/shared"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
"github.com/test-instructor/yangfan/parsing/hrp/internal/builtin"
"github.com/test-instructor/yangfan/parsing/... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/plugin_test.go | parsing/hrp/plugin_test.go | package hrp
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestLocateFile(t *testing.T) {
// specify target file path
_, err := locateFile(tmpl("plugin/debugtalk.go"), PluginGoSourceFile)
if !assert.Nil(t, err) {
t.Fatal()
}
// specify path with the same dir
_, err = locateFile(tmpl("plugi... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/summary_test.go | parsing/hrp/summary_test.go | package hrp
import "testing"
func TestGenHTMLReport(t *testing.T) {
summary := newOutSummary()
caseSummary1 := newSummary()
caseSummary2 := newSummary()
stepResult1 := &StepResult{}
stepResult2 := &StepResult{
Name: "Test",
StepType: stepTypeRequest,
Success: false,
ContentSize: 0,
Attach... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/parser_test.go | parsing/hrp/parser_test.go | package hrp
import (
"sort"
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestBuildURL(t *testing.T) {
var url string
url = buildURL("https://postman-echo.com", "/get")
if !assert.Equal(t, url, "https://postman-echo.com/get") {
t.Fatal()
}
url = buildURL("https://postman-echo.com", "get")
... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/runner.go | parsing/hrp/runner.go | package hrp
import (
"crypto/tls"
_ "embed"
"fmt"
"net"
"net/http"
"net/http/cookiejar"
"net/url"
"path/filepath"
"strings"
"testing"
"time"
"github.com/gorilla/websocket"
"github.com/httprunner/funplugin"
"github.com/jinzhu/copier"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
"golang.org/x/ne... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/boomer_test.go | parsing/hrp/boomer_test.go | package hrp
import (
"testing"
"time"
)
func TestBoomerStandaloneRun(t *testing.T) {
buildHashicorpGoPlugin()
defer removeHashicorpGoPlugin()
testcase1 := &TestCase{
Config: NewConfig("TestCase1").SetBaseURL("https://httpbin.org"),
TestSteps: []IStep{
NewStep("headers").
GET("/headers").
Validate... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/testcase.go | parsing/hrp/testcase.go | package hrp
import (
"fmt"
"path/filepath"
"strings"
"github.com/mitchellh/mapstructure"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
"github.com/test-instructor/yangfan/parsing/hrp/internal/builtin"
"github.com/test-instructor/yangfan/parsing/hrp/internal/code"
)
// ITestCase represents interface fo... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/step_request_test.go | parsing/hrp/step_request_test.go | package hrp
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
)
var (
stepGET = NewStep("get with params").
GET("/get").
WithParams(map[string]interface{}{"foo1": "bar1", "foo2": "bar2"}).
WithHeaders(map[string]string{"User-Agent": "HttpRunnerPlus"}).
WithCookies(map[string]string{"user": "... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/server.go | parsing/hrp/server.go | package hrp
import (
"context"
"errors"
"fmt"
"io/ioutil"
"log"
"net/http"
"strings"
"github.com/mitchellh/mapstructure"
"github.com/test-instructor/yangfan/parsing/hrp/internal/json"
"github.com/test-instructor/yangfan/parsing/hrp/pkg/boomer"
)
const jsonContentType = "application/json; encoding=utf-8"
... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/step_thinktime.go | parsing/hrp/step_thinktime.go | package hrp
import (
"time"
"github.com/rs/zerolog/log"
"github.com/test-instructor/yangfan/parsing/hrp/internal/builtin"
)
type ThinkTime struct {
Time float64 `json:"time" yaml:"time"`
}
// StepThinkTime implements IStep interface.
type StepThinkTime struct {
step *TStep
}
func (s *StepThinkTime) Name() st... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/step_rendezvous_test.go | parsing/hrp/step_rendezvous_test.go | package hrp
import (
"math"
"testing"
)
func TestRunCaseWithRendezvous(t *testing.T) {
rendezvousBoundaryTestcase := &TestCase{
Config: NewConfig("run request with functions").
SetBaseURL("https://postman-echo.com").
WithVariables(map[string]interface{}{
"n": 5,
"a": 12.3,
"b": 3.45,
}),
T... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/step.go | parsing/hrp/step.go | package hrp
type StepType string
// 步骤类型常量
const (
stepTypeRequest StepType = "request"
stepTypeAPI StepType = "api"
stepTypeTestCase StepType = "testcase"
stepTypeTransaction StepType = "transaction"
stepTypeRendezvous StepType = "rendezvous"
stepTypeThinkTime StepType = "thinktime"
stepType... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/step_api.go | parsing/hrp/step_api.go | package hrp
import (
"fmt"
"github.com/jinzhu/copier"
"github.com/rs/zerolog/log"
"github.com/test-instructor/yangfan/parsing/hrp/internal/builtin"
)
// IAPI represents interface for api,
// includes API and APIPath.
// API实现有2中方式,一种是直接定义API结构体,另一种是定义APIPath结构体,然后通过APIPath结构体的GetPath()方法获取API结构体
type IAPI inter... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/plugin.go | parsing/hrp/plugin.go | package hrp
import (
"fmt"
"os"
"path/filepath"
"strings"
"sync"
"github.com/httprunner/funplugin"
"github.com/httprunner/funplugin/fungo"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
"github.com/test-instructor/yangfan/parsing/hrp/internal/code"
"github.com/test-instructor/yangfan/parsing/hrp/inte... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/build_test.go | parsing/hrp/build_test.go | package hrp
import (
"path/filepath"
"regexp"
"testing"
"github.com/stretchr/testify/assert"
"github.com/test-instructor/yangfan/parsing/hrp/internal/builtin"
)
func TestRun(t *testing.T) {
err := BuildPlugin(tmpl("plugin/debugtalk.go"), "./debugtalk.bin")
if !assert.Nil(t, err) {
t.Fatal()
}
genDebugTa... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/parameters_test.go | parsing/hrp/parameters_test.go | package hrp
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
)
func TestLoadParameters(t *testing.T) {
testData := []struct {
configParameters map[string]interface{}
loadedParameters map[string]Parameters
}{
{
map[string]interface{}{
"username-password": fmt.Sprintf("${parameterize(%s/... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/response_test.go | parsing/hrp/response_test.go | package hrp
import (
"io"
"net/http"
"strings"
"testing"
"github.com/stretchr/testify/assert"
)
func TestSearchJmespath(t *testing.T) {
testText := `{"a": {"b": "foo"}, "c": "bar", "d": {"e": [{"f": "foo"}, {"f": "bar"}]}}`
testData := []struct {
raw string
expected string
}{
{"body.a.b", "foo"},
... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/step_websocket.go | parsing/hrp/step_websocket.go | package hrp
import (
"bytes"
"fmt"
"net/http"
"testing"
"time"
"unsafe"
"github.com/gorilla/websocket"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
"github.com/test-instructor/yangfan/parsing/hrp/internal/builtin"
"github.com/test-instructor/yangfan/parsing/hrp/internal/json"
)
const (
wsOpen ... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/httpstat/main.go | parsing/hrp/pkg/httpstat/main.go | // Package httpstat traces HTTP latency infomation (DNSLookup, TCP Connection and so on) on any golang HTTP request.
// It uses `httptrace` package.
// Inspired by https://github.com/tcnksm/go-httpstat and https://github.com/davecheney/httpstat
package httpstat
import (
"context"
"crypto/tls"
"fmt"
"net/http"
"ne... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/httpstat/demo/main_test.go | parsing/hrp/pkg/httpstat/demo/main_test.go | package demo
import (
"fmt"
"net/http"
"testing"
"time"
"github.com/test-instructor/yangfan/parsing/hrp/pkg/httpstat"
)
func TestMain(t *testing.T) {
var httpStat httpstat.Stat
req, _ := http.NewRequest("GET", "https://httprunner.com", nil)
ctx := httpstat.WithHTTPStat(req, &httpStat)
client := &http.Clie... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/swipe_test.go | parsing/hrp/pkg/uixt/swipe_test.go | //go:build localtest
package uixt
import (
"testing"
)
func TestSwipeUntil(t *testing.T) {
driverExt, err := iosDevice.NewDriver(nil)
checkErr(t, err)
var point PointF
findApp := func(d *DriverExt) error {
var err error
point, err = d.GetTextXY("抖音")
return err
}
foundAppAction := func(d *DriverExt) er... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/ios_test.go | parsing/hrp/pkg/uixt/ios_test.go | //go:build localtest
package uixt
import (
"bytes"
"fmt"
"testing"
"time"
)
var (
bundleId = "com.apple.Preferences"
driver WebDriver
)
func setup(t *testing.T) {
device, err := NewIOSDevice()
if err != nil {
t.Fatal(err)
}
driver, err = device.NewUSBDriver(nil)
if err != nil {
t.Fatal(err)
}
}
... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/android_device.go | parsing/hrp/pkg/uixt/android_device.go | package uixt
import (
"bytes"
"context"
"fmt"
"net"
"os/exec"
"strings"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
"github.com/test-instructor/yangfan/parsing/hrp/internal/code"
"github.com/test-instructor/yangfan/parsing/hrp/internal/json"
"github.com/test-instructor/yangfan/parsing/hrp/internal... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/android_adb_driver.go | parsing/hrp/pkg/uixt/android_adb_driver.go | package uixt
import (
"bytes"
"fmt"
"strconv"
"strings"
"time"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
"github.com/test-instructor/yangfan/parsing/hrp/internal/code"
"github.com/test-instructor/yangfan/parsing/hrp/pkg/gadb"
)
type adbDriver struct {
Driver
adbClient *gadb.Device
logcat *... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/ocr_test.go | parsing/hrp/pkg/uixt/ocr_test.go | //go:build ocr
package uixt
import (
"testing"
)
func TestDriverExtOCR(t *testing.T) {
driverExt, err := iosDevice.NewDriver(nil)
checkErr(t, err)
x, y, width, height, err := driverExt.FindTextByOCR("抖音")
checkErr(t, err)
t.Logf("x: %v, y: %v, width: %v, height: %v", x, y, width, height)
driverExt.Driver.Ta... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/drag_test.go | parsing/hrp/pkg/uixt/drag_test.go | //go:build localtest
package uixt
import (
"testing"
)
func TestDriverExt_Drag(t *testing.T) {
driverExt, err := iosDevice.NewDriver(nil)
checkErr(t, err)
pathSearch := "/Users/hero/Documents/temp/2020-05/opencv/IMG_map.png"
// err = driverExt.Drag(pathSearch, 300, 500, 2)
// checkErr(t, err)
err = driverE... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/tap_test.go | parsing/hrp/pkg/uixt/tap_test.go | //go:build localtest
package uixt
import (
"testing"
)
var iosDevice *IOSDevice
func init() {
iosDevice, _ = NewIOSDevice()
}
func checkErr(t *testing.T, err error, msg ...string) {
if err != nil {
if len(msg) == 0 {
t.Fatal(err)
} else {
t.Fatal(msg, err)
}
}
}
func TestDriverExt_TapXY(t *testing... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/client.go | parsing/hrp/pkg/uixt/client.go | package uixt
import (
"bytes"
"context"
"encoding/json"
"io"
"io/ioutil"
"net"
"net/http"
"net/url"
"path"
"strings"
"time"
"github.com/rs/zerolog/log"
)
type Driver struct {
urlPrefix *url.URL
sessionId string
client *http.Client
// cache the last launched package name
lastLaunchedPackageName st... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/android_test.go | parsing/hrp/pkg/uixt/android_test.go | //go:build localtest
package uixt
import (
"encoding/json"
"fmt"
"io/ioutil"
"testing"
"time"
)
var uiaServerURL = "http://localhost:6790/wd/hub"
func TestDriver_NewSession(t *testing.T) {
driver, err := NewUIADriver(nil, uiaServerURL)
if err != nil {
t.Fatal(err)
}
firstMatchEntry := make(map[string]in... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/drag.go | parsing/hrp/pkg/uixt/drag.go | package uixt
func (dExt *DriverExt) Drag(pathname string, toX, toY int, pressForDuration ...float64) (err error) {
return dExt.DragFloat(pathname, float64(toX), float64(toY), pressForDuration...)
}
func (dExt *DriverExt) DragFloat(pathname string, toX, toY float64, pressForDuration ...float64) (err error) {
return ... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/interface.go | parsing/hrp/pkg/uixt/interface.go | package uixt
import (
"bytes"
"math"
"strings"
"time"
"github.com/test-instructor/yangfan/parsing/hrp/internal/builtin"
)
var (
DefaultWaitTimeout = 60 * time.Second
DefaultWaitInterval = 400 * time.Millisecond
)
type AlertAction string
const (
AlertActionAccept AlertAction = "accept"
AlertActionDismiss... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/swipe.go | parsing/hrp/pkg/uixt/swipe.go | package uixt
import (
"fmt"
"time"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
"github.com/test-instructor/yangfan/parsing/hrp/internal/builtin"
"github.com/test-instructor/yangfan/parsing/hrp/internal/code"
)
func assertRelative(p float64) bool {
return p >= 0 && p <= 1
}
// SwipeRelative swipe fro... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/opencv_test.go | parsing/hrp/pkg/uixt/opencv_test.go | //go:build opencv
package uixt
import (
"bytes"
"image"
"image/color"
"io/ioutil"
"sort"
"strconv"
"testing"
"gocv.io/x/gocv"
)
func TestFindImageLocation(t *testing.T) {
pathSource := "/Users/hero/Documents/temp/2020-05/opencv/Snipaste_2020-05-18_16-20-31.png"
pathSearch := "/Users/hero/Documents/temp/20... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/ios_device.go | parsing/hrp/pkg/uixt/ios_device.go | package uixt
import (
"context"
"fmt"
"io"
builtinLog "log"
"net"
"net/http"
"net/url"
"os"
"path/filepath"
"strconv"
"time"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
"github.com/test-instructor/yangfan/parsing/hrp/internal/code"
"github.com/test-instructor/yangfan/parsing/hrp/internal/env"
... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/tap.go | parsing/hrp/pkg/uixt/tap.go | package uixt
import (
"fmt"
)
func (dExt *DriverExt) TapAbsXY(x, y float64, options ...DataOption) error {
// tap on absolute coordinate [x, y]
return dExt.Driver.TapFloat(x, y, options...)
}
func (dExt *DriverExt) TapXY(x, y float64, options ...DataOption) error {
// tap on [x, y] percent of window size
if x >... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/ext.go | parsing/hrp/pkg/uixt/ext.go | package uixt
import (
"bytes"
"encoding/json"
"fmt"
"image"
"image/gif"
"image/jpeg"
"image/png"
"math/rand"
"mime"
"mime/multipart"
"net/http"
"os"
"path/filepath"
"strings"
"time"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
"github.com/test-instructor/yangfan/parsing/hrp/internal/builtin"
... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/android_key.go | parsing/hrp/pkg/uixt/android_key.go | package uixt
// See https://developer.android.com/reference/android/view/KeyEvent
type KeyMeta int
const (
KMEmpty KeyMeta = 0 // As a `null`
KMCapLocked KeyMeta = 0x100 // SHIFT key locked in CAPS mode.
KMAltLocked KeyMeta = 0x200 // ALT key locked.
KMSymLocked KeyMeta = 0x400 // SYM key locked.
KMSele... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/input.go | parsing/hrp/pkg/uixt/input.go | package uixt
func (dExt *DriverExt) Input(text string) (err error) {
return dExt.Driver.Input(text)
}
| go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/ocr_vedem.go | parsing/hrp/pkg/uixt/ocr_vedem.go | package uixt
import (
"bytes"
"fmt"
"image"
"io/ioutil"
"mime/multipart"
"net/http"
"strings"
"time"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
"github.com/test-instructor/yangfan/parsing/hrp/internal/builtin"
"github.com/test-instructor/yangfan/parsing/hrp/internal/code"
"github.com/test-instr... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/ocr_vedem_test.go | parsing/hrp/pkg/uixt/ocr_vedem_test.go | //go:build localtest
package uixt
import (
"bytes"
"fmt"
"os"
"testing"
)
func checkOCR(buff *bytes.Buffer) error {
service, err := newVEDEMOCRService()
if err != nil {
return err
}
ocrResults, err := service.getOCRResult(buff)
if err != nil {
return err
}
fmt.Println(ocrResults)
return nil
}
func T... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/android_uia2_driver.go | parsing/hrp/pkg/uixt/android_uia2_driver.go | package uixt
import (
"bytes"
"encoding/base64"
"encoding/json"
"fmt"
"net"
"net/url"
"strconv"
"strings"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
"github.com/test-instructor/yangfan/parsing/hrp/internal/code"
)
var errDriverNotImplemented = errors.New("driver method not implemented")
type ui... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/opencv.go | parsing/hrp/pkg/uixt/opencv.go | //go:build opencv
package uixt
import (
"bytes"
"fmt"
"image"
"image/color"
"io/ioutil"
"log"
"math"
"os"
"github.com/pkg/errors"
"gocv.io/x/gocv"
"github.com/test-instructor/yangfan/parsing/hrp/internal/builtin"
)
const (
// TmCcoeffNormed maps to TM_CCOEFF_NORMED
TmCcoeffNormed TemplateMatchMode = i... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/ios_driver.go | parsing/hrp/pkg/uixt/ios_driver.go | package uixt
import (
"bytes"
"encoding/base64"
builtinJSON "encoding/json"
"fmt"
"net"
"net/http"
"net/url"
"regexp"
"strings"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
"github.com/test-instructor/yangfan/parsing/hrp/internal/code"
"github.com/test-instructor/yangfan/parsing/hrp/internal/json... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/opencv_off.go | parsing/hrp/pkg/uixt/opencv_off.go | //go:build !opencv
package uixt
import (
"image"
"github.com/rs/zerolog/log"
)
func (dExt *DriverExt) extendCV(options ...CVOption) (err error) {
return nil
}
func (dExt *DriverExt) FindAllImageRect(search string) (rects []image.Rectangle, err error) {
log.Fatal().Msg("opencv is not supported")
return
}
func... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/uixt/demo/main_test.go | parsing/hrp/pkg/uixt/demo/main_test.go | //go:build localtest
package demo
import (
"testing"
"time"
"github.com/test-instructor/yangfan/parsing/hrp/pkg/uixt"
)
func TestIOSDemo(t *testing.T) {
device, err := uixt.NewIOSDevice(
uixt.WithWDAPort(8700), uixt.WithWDAMjpegPort(8800),
uixt.WithResetHomeOnStartup(false), // not reset home on startup
)
... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/gidevice/device_test.go | parsing/hrp/pkg/gidevice/device_test.go | //go:build localtest
package gidevice
import (
"fmt"
"os"
"os/signal"
"testing"
"time"
)
var dev Device
func setupDevice(t *testing.T) {
setupUsbmux(t)
devices, err := um.Devices()
if err != nil {
t.Fatal(err)
}
if len(devices) == 0 {
t.Fatal("No Device")
}
dev = devices[0]
}
func Test_device_Read... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/gidevice/crashreportmover.go | parsing/hrp/pkg/gidevice/crashreportmover.go | package gidevice
import (
"fmt"
"io"
"os"
"path"
"path/filepath"
"strings"
"howett.net/plist"
"github.com/test-instructor/yangfan/parsing/hrp/pkg/gidevice/pkg/libimobiledevice"
)
var _ CrashReportMover = (*crashReportMover)(nil)
func newCrashReportMover(client *libimobiledevice.CrashReportMoverClient) *cra... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/gidevice/perfd.go | parsing/hrp/pkg/gidevice/perfd.go | package gidevice
import (
"context"
"encoding/binary"
"encoding/json"
"fmt"
"log"
"net"
"strconv"
"time"
"github.com/test-instructor/yangfan/parsing/hrp/pkg/gidevice/pkg/libimobiledevice"
)
type PerfOptions struct {
// system
SysCPU bool `json:"sys_cpu,omitempty" yaml:"sys_cpu,omitempty"`
SysMem ... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/gidevice/installationproxy.go | parsing/hrp/pkg/gidevice/installationproxy.go | package gidevice
import (
"fmt"
"github.com/test-instructor/yangfan/parsing/hrp/pkg/gidevice/pkg/libimobiledevice"
)
var _ InstallationProxy = (*installationProxy)(nil)
func newInstallationProxy(client *libimobiledevice.InstallationProxyClient) *installationProxy {
return &installationProxy{
client: client,
}... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
test-instructor/yangfan | https://github.com/test-instructor/yangfan/blob/b652da8cc7c6973b1ff10c8154fac49f2d99834d/parsing/hrp/pkg/gidevice/screenshot_test.go | parsing/hrp/pkg/gidevice/screenshot_test.go | //go:build localtest
package gidevice
import (
"image"
"image/jpeg"
"image/png"
"os"
"testing"
)
var screenshotSrv Screenshot
func setupScreenshotSrv(t *testing.T) {
setupLockdownSrv(t)
var err error
if lockdownSrv, err = dev.lockdownService(); err != nil {
t.Fatal(err)
}
if screenshotSrv, err = lockd... | go | Apache-2.0 | b652da8cc7c6973b1ff10c8154fac49f2d99834d | 2026-01-07T09:45:38.570425Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.