mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 13:18:53 +00:00
all: replace logtail.{Public,Private}ID with logid.{Public,Private}ID (#7404)
The log ID types were moved to a separate package so that code that only depend on log ID types do not need to link in the logic for the logtail client itself. Not all code need the logtail client. Signed-off-by: Joe Tsai <joetsai@digital-static.net>
This commit is contained in:
@@ -43,7 +43,9 @@ import (
|
||||
"tailscale.com/safesocket"
|
||||
"tailscale.com/smallzstd"
|
||||
"tailscale.com/types/logger"
|
||||
"tailscale.com/types/logid"
|
||||
"tailscale.com/util/clientmetric"
|
||||
"tailscale.com/util/must"
|
||||
"tailscale.com/util/racebuild"
|
||||
"tailscale.com/util/winutil"
|
||||
"tailscale.com/version"
|
||||
@@ -94,8 +96,8 @@ func LogHost() string {
|
||||
// Config represents an instance of logs in a collection.
|
||||
type Config struct {
|
||||
Collection string
|
||||
PrivateID logtail.PrivateID
|
||||
PublicID logtail.PublicID
|
||||
PrivateID logid.PrivateID
|
||||
PublicID logid.PublicID
|
||||
}
|
||||
|
||||
// Policy is a logger and its public ID.
|
||||
@@ -103,15 +105,12 @@ type Policy struct {
|
||||
// Logtail is the logger.
|
||||
Logtail *logtail.Logger
|
||||
// PublicID is the logger's instance identifier.
|
||||
PublicID logtail.PublicID
|
||||
PublicID logid.PublicID
|
||||
}
|
||||
|
||||
// NewConfig creates a Config with collection and a newly generated PrivateID.
|
||||
func NewConfig(collection string) *Config {
|
||||
id, err := logtail.NewPrivateID()
|
||||
if err != nil {
|
||||
panic("logtail.NewPrivateID should never fail")
|
||||
}
|
||||
id := must.Get(logid.NewPrivateID())
|
||||
return &Config{
|
||||
Collection: collection,
|
||||
PrivateID: id,
|
||||
|
Reference in New Issue
Block a user