summaryrefslogtreecommitdiff
path: root/bilibili/client.go
diff options
context:
space:
mode:
authorKeuin <[email protected]>2023-07-11 22:56:07 +0800
committerKeuin <[email protected]>2023-07-11 22:56:07 +0800
commitf5c63cde56eb35c0125a0545f084441cdd4340ab (patch)
treecf24779daaa3067902bef91d21bcdee7a78fd059 /bilibili/client.go
parent7fd817f6d1ead3de85294c1893a6e1572a1d12e3 (diff)
Refactor: move data structures to a separate package to avoid circular dependency.
Diffstat (limited to 'bilibili/client.go')
-rw-r--r--bilibili/client.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/bilibili/client.go b/bilibili/client.go
index 65d858f..35d06e4 100644
--- a/bilibili/client.go
+++ b/bilibili/client.go
@@ -7,6 +7,7 @@ package bilibili
import (
"context"
"github.com/keuin/slbr/logging"
+ "github.com/keuin/slbr/types"
"net"
"net/http"
)
@@ -21,15 +22,15 @@ type Bilibili struct {
userAgent string
http *http.Client
ctx context.Context
- netTypes []IpNetType
+ netTypes []types.IpNetType
logger logging.Logger
}
-func NewBilibiliWithContext(ctx context.Context, netTypes []IpNetType, logger logging.Logger) Bilibili {
- var nets []IpNetType
+func NewBilibiliWithContext(ctx context.Context, netTypes []types.IpNetType, logger logging.Logger) Bilibili {
+ var nets []types.IpNetType
nets = append(nets, netTypes...)
if len(nets) == 0 {
- nets = append(nets, IP64)
+ nets = append(nets, types.IP64)
}
var dialer net.Dialer
@@ -47,7 +48,7 @@ func NewBilibiliWithContext(ctx context.Context, netTypes []IpNetType, logger lo
}
}
-func NewBilibiliWithNetType(netTypes []IpNetType, logger logging.Logger) Bilibili {
+func NewBilibiliWithNetType(netTypes []types.IpNetType, logger logging.Logger) Bilibili {
ctx := context.Background()
return NewBilibiliWithContext(ctx, netTypes, logger)
}