Skip to content

Commit

Permalink
get rid of internal/ (#102)
Browse files Browse the repository at this point in the history
This is a pre-requisite to breaking up the repo
  • Loading branch information
muir committed Jan 6, 2024
1 parent aa1b1fd commit 0f25410
Show file tree
Hide file tree
Showing 21 changed files with 46 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ line.go linguist-generated
seed.go linguist-generated
span.go linguist-generated
sub.go linguist-generated
internal/enumer_test.go linguist-generated
xopat/attributes.go linguist-generated
xopbase/abbr.go linguist-generated
xopbase/base.go linguist-generated
Expand All @@ -25,6 +24,7 @@ xoppb/replay.go linguist-generated
xoprecorder/recorder.go linguist-generated
xoprecorder/replay.go linguist-generated
xoptrace/hexbytes.go linguist-generated
xoputil/enumer_test.go linguist-generated
xopbase/xopbaseutil/metadata.go linguist-generated
xopjson/xopjsonutil/attributes.go linguist-generated
xoptest/xoptestutil/enums.go linguist-generated
Expand Down
14 changes: 7 additions & 7 deletions seed.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions seed.zzzgo
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"path/filepath"
"time"

"github.com/xoplog/xop-go/internal/util/version"
"github.com/xoplog/xop-go/xopat"
"github.com/xoplog/xop-go/xopbase"
"github.com/xoplog/xop-go/xoptrace"
"github.com/xoplog/xop-go/xoputil/xopversion"
)

// Seed is used to create a Logger. Seed contains
Expand Down Expand Up @@ -148,16 +148,16 @@ func (seed Seed) applyMods(mods []SeedModifier) Seed {
mod(&seed)
}
if seed.sourceInfo.Source == "" {
seed.sourceInfo.Source, seed.sourceInfo.SourceVersion = version.SplitVersion(filepath.Base(os.Args[0]))
seed.sourceInfo.Source, seed.sourceInfo.SourceVersion = xopversion.SplitVersion(filepath.Base(os.Args[0]))
}
if seed.sourceInfo.SourceVersion == nil {
seed.sourceInfo.SourceVersion = version.ZeroVersion
seed.sourceInfo.SourceVersion = xopversion.ZeroVersion
}
if seed.sourceInfo.Namespace == "" {
seed.sourceInfo.Namespace, seed.sourceInfo.NamespaceVersion = version.SplitVersion(xopat.DefaultNamespace)
seed.sourceInfo.Namespace, seed.sourceInfo.NamespaceVersion = xopversion.SplitVersion(xopat.DefaultNamespace)
}
if seed.sourceInfo.NamespaceVersion == nil {
seed.sourceInfo.NamespaceVersion = version.ZeroVersion
seed.sourceInfo.NamespaceVersion = xopversion.ZeroVersion
}
return seed
}
Expand Down Expand Up @@ -267,7 +267,7 @@ func WithSettings(f func(*LogSettings)) SeedModifier {
// If not specified, namespace will default to xopat.DefaultNamespace
func WithNamespace(namespace string) SeedModifier {
return func(s *Seed) {
s.sourceInfo.Namespace, s.sourceInfo.NamespaceVersion = version.SplitVersion(namespace)
s.sourceInfo.Namespace, s.sourceInfo.NamespaceVersion = xopversion.SplitVersion(namespace)
}
}

Expand All @@ -279,7 +279,7 @@ func WithNamespace(namespace string) SeedModifier {
// If not specified, filepath.Base(os.Argv[0]) will be used.
func WithSource(source string) SeedModifier {
return func(s *Seed) {
s.sourceInfo.Source, s.sourceInfo.SourceVersion = version.SplitVersion(source)
s.sourceInfo.Source, s.sourceInfo.SourceVersion = xopversion.SplitVersion(source)
}
}

Expand Down
4 changes: 2 additions & 2 deletions xopat/attributes.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions xopat/attributes.zzzgo
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
"sync"
"sync/atomic"

"github.com/xoplog/xop-go/internal/util/version"
"github.com/xoplog/xop-go/xopproto"
"github.com/xoplog/xop-go/xoputil"
"github.com/xoplog/xop-go/xoputil/xopversion"

"github.com/Masterminds/semver/v3"
"github.com/pkg/errors"
Expand Down Expand Up @@ -150,7 +150,7 @@ func (s Make) make(registry *Registry, exampleValue interface{}, subType Attribu
ck.AddConsoleString(s.Key)
ck.AppendByte('=')

namespace, sver, err := version.SplitVersionWithError(namespace)
namespace, sver, err := xopversion.SplitVersionWithError(namespace)
if err != nil {
return Attribute{}, err
}
Expand Down
6 changes: 3 additions & 3 deletions xopconsole/replay.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions xopconsole/replay.zzzgo
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,21 @@ package xopconsole
import (
"bufio"
"context"
"fmt"
"io"
"regexp"
"runtime"
"strconv"
"strings"
"time"

"github.com/xoplog/xop-go/internal/util/version"
"github.com/xoplog/xop-go/xopat"
"github.com/xoplog/xop-go/xopbase"
"github.com/xoplog/xop-go/xopnum"
"github.com/xoplog/xop-go/xopproto"
"github.com/xoplog/xop-go/xoptrace"
"github.com/xoplog/xop-go/xoputil"
"github.com/xoplog/xop-go/xoputil/replayutil"
"github.com/xoplog/xop-go/xoputil/xopversion"

"github.com/pkg/errors"
)
Expand Down Expand Up @@ -565,8 +564,8 @@ func (x replayRequest) replayRequestStart(ctx context.Context, t string) error {
return errors.Errorf("unexpected stuff in request start: '%s'", word)
}
}
ns, nsVers := version.SplitVersion(x.namespaceAndVersion)
so, soVers := version.SplitVersion(x.sourceAndVersion)
ns, nsVers := xopversion.SplitVersion(x.namespaceAndVersion)
so, soVers := xopversion.SplitVersion(x.sourceAndVersion)
sourceInfo := xopbase.SourceInfo{
Source: so,
SourceVersion: soVers,
Expand Down
6 changes: 3 additions & 3 deletions xopjson/replay.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions xopjson/replay.zzzgo
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"strings"
"time"

"github.com/xoplog/xop-go/internal/util/version"
"github.com/xoplog/xop-go/xopat"
"github.com/xoplog/xop-go/xopbase"
"github.com/xoplog/xop-go/xopnum"
Expand All @@ -20,6 +19,7 @@ import (
"github.com/xoplog/xop-go/xoptrace"
"github.com/xoplog/xop-go/xoputil"
"github.com/xoplog/xop-go/xoputil/replayutil"
"github.com/xoplog/xop-go/xoputil/xopversion"

"github.com/pkg/errors"
)
Expand Down Expand Up @@ -260,11 +260,11 @@ func ReplayFromStrings(ctx context.Context, data string, logger xopbase.Logger)
}
var err error
var sourceInfo xopbase.SourceInfo
sourceInfo.Source, sourceInfo.SourceVersion, err = version.SplitVersionWithError(requestInput.Source)
sourceInfo.Source, sourceInfo.SourceVersion, err = xopversion.SplitVersionWithError(requestInput.Source)
if err != nil {
return errors.Errorf("invalid source (%s) in request (%s)", requestInput.Source, requestInput.unparsed)
}
sourceInfo.Namespace, sourceInfo.NamespaceVersion, err = version.SplitVersionWithError(requestInput.Namespace)
sourceInfo.Namespace, sourceInfo.NamespaceVersion, err = xopversion.SplitVersionWithError(requestInput.Namespace)
if err != nil {
return errors.Errorf("invalid namespace (%s) in request (%s)", requestInput.Namespace, requestInput.unparsed)
}
Expand Down
2 changes: 1 addition & 1 deletion xopotel/buffered.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion xopotel/buffered.zzzgo
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (
"time"

"github.com/muir/gwrap"
"github.com/xoplog/xop-go/internal/util/pointer"
"github.com/xoplog/xop-go/xopat"
"github.com/xoplog/xop-go/xopbase"
"github.com/xoplog/xop-go/xopbase/xopbaseutil"
"github.com/xoplog/xop-go/xoprecorder"
"github.com/xoplog/xop-go/xoptrace"
"github.com/xoplog/xop-go/xoputil/pointer"

"github.com/google/uuid"
"go.opentelemetry.io/otel/attribute"
Expand Down
6 changes: 3 additions & 3 deletions xopotel/export.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions xopotel/export.zzzgo
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import (
"sync/atomic"
"time"

"github.com/xoplog/xop-go/internal/util/version"
"github.com/xoplog/xop-go/xopat"
"github.com/xoplog/xop-go/xopbase"
"github.com/xoplog/xop-go/xopconst"
"github.com/xoplog/xop-go/xopnum"
"github.com/xoplog/xop-go/xopproto"
"github.com/xoplog/xop-go/xoptrace"
"github.com/xoplog/xop-go/xoputil/xopversion"

"github.com/muir/gwrap"
"github.com/muir/list"
Expand Down Expand Up @@ -646,8 +646,8 @@ func buildSourceInfo(span sdktrace.ReadOnlySpan, attributeMap aMap) xopbase.Sour
}
namespace = defaulted(attributeMap.GetString(xopNamespace), source)
}
si.Source, si.SourceVersion = version.SplitVersion(source)
si.Namespace, si.NamespaceVersion = version.SplitVersion(namespace)
si.Source, si.SourceVersion = xopversion.SplitVersion(source)
si.Namespace, si.NamespaceVersion = xopversion.SplitVersion(namespace)
return si
}

Expand Down
4 changes: 2 additions & 2 deletions xoprecorder/recorder.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions xoprecorder/recorder.zzzgo
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ import (
"sync"
"time"

"github.com/xoplog/xop-go/internal/util/generic"
"github.com/xoplog/xop-go/internal/util/pointer"
"github.com/xoplog/xop-go/xopat"
"github.com/xoplog/xop-go/xopbase"
"github.com/xoplog/xop-go/xopbase/xopbaseutil"
"github.com/xoplog/xop-go/xopnum"
"github.com/xoplog/xop-go/xoptrace"
"github.com/xoplog/xop-go/xoputil"
"github.com/xoplog/xop-go/xoputil/generic"
"github.com/xoplog/xop-go/xoputil/pointer"

"github.com/google/uuid"
"github.com/muir/list"
Expand Down
File renamed without changes.

0 comments on commit 0f25410

Please sign in to comment.