Skip to content

Commit

Permalink
remove remaining references to gravestench/runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
gravestench committed Dec 18, 2023
1 parent f160c3b commit b1f2c93
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 16 deletions.
3 changes: 1 addition & 2 deletions cmd/charm/simple_tui/bubbletea_wrapper_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"time"

tea "github.com/charmbracelet/bubbletea"
"github.com/gravestench/runtime/pkg/events"
"github.com/gravestench/servicemesh"
)

Expand All @@ -23,7 +22,7 @@ func (b *bubbleteaService) Init(mesh servicemesh.Mesh) {

b.bindExisting(mesh)

mesh.Events().On(events.EventServiceAdded, func(...any) {
mesh.Events().On(servicemesh.EventServiceAdded, func(...any) {
b.bindExisting(mesh)
})
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/dependency_injection/non_service_dependencies/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ func main() {
mesh := servicemesh.New()

// each service has a dependency that is not
// actually resolved through the runtime but by
// actually resolved through the service mesh but by
// some other means (that part is up to you).
mesh.Add(newServiceWithAsyncDependencyResolution())
mesh.Add(newServiceWithAsyncDependencyResolution())
Expand Down
7 changes: 3 additions & 4 deletions cmd/dependency_injection/non_service_dependencies/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"time"

"github.com/google/uuid"
"github.com/gravestench/runtime/pkg"
"github.com/gravestench/servicemesh"
)

Expand Down Expand Up @@ -43,10 +42,10 @@ func (s *Service) DependenciesResolved() bool {
return s.dependency != nil
}

func (s *Service) ResolveDependencies(_ pkg.IsRuntime) {
// in this example, we are not using the runtime to find our dependencies,
func (s *Service) ResolveDependencies(_ servicemesh.Mesh) {
// in this example, we are not using the service mesh to find our dependencies,
// they are resolved some other way (this is up to you). However, we
// do implement servicemesh.HasDependencies so that the runtime knows not
// do implement servicemesh.HasDependencies so that the service mesh knows not
// to call Init unless until we have resolved our deps ourselves.
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/dependency_injection/service_dependencies/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ func main() {
// the inverse is true of serviceB, which needs to call the A() method.
//
// both of these services implement servicemesh.HasDependencies, and they both
// will use the runtime to find and assign a service that matches the
// will use the service mesh to find and assign a service that matches the
// interface they are looking for.
mesh.Add(serviceA.New("serviceA instance"))
mesh.Add(serviceB.New("serviceB instance"))

// when this runs, you will see the runtime initiates the dependency
// when this runs, you will see the service mesh initiates the dependency
// resolution and the services will end up with their dependencies met.
mesh.Run()
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (s *Service) DependenciesResolved() bool {
}

func (s *Service) ResolveDependencies(mesh servicemesh.Mesh) {
// here, we iterate over all services from the runtime
// here, we iterate over all services from the service mesh
// and check if the service implements something we need.
for _, service := range mesh.Services() {
if b, ok := service.(hasB); ok {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (s *Service) DependenciesResolved() bool {
}

func (s *Service) ResolveDependencies(mesh servicemesh.Mesh) {
// here, we iterate over all services from the runtime
// here, we iterate over all services from the service mesh
// and check if the service implements something we need.
for _, service := range mesh.Services() {
if a, ok := service.(hasA); ok {
Expand Down
3 changes: 0 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ require (
github.com/gin-contrib/gzip v0.0.6
github.com/gin-gonic/gin v1.9.1
github.com/google/uuid v1.5.0
github.com/gravestench/runtime v0.0.0-20231002182113-640425b821c6
github.com/gravestench/servicemesh v0.0.0-20231217214505-398708ee4e08
github.com/hegedustibor/htgo-tts v0.0.0-20230402053941-cd8d1a158135
golang.org/x/oauth2 v0.15.0
Expand Down Expand Up @@ -100,7 +99,6 @@ require (
github.com/liquidweb/liquidweb-cli v0.6.9 // indirect
github.com/liquidweb/liquidweb-go v1.6.3 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
Expand Down Expand Up @@ -128,7 +126,6 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pquerna/otp v1.3.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rs/zerolog v1.31.0 // indirect
github.com/sacloud/libsacloud v1.36.2 // indirect
github.com/sirupsen/logrus v1.7.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
Expand Down
3 changes: 1 addition & 2 deletions services/config_file/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"log/slog"
"sync"

"github.com/gravestench/runtime/pkg/events"
"github.com/gravestench/servicemesh"
)

Expand Down Expand Up @@ -49,7 +48,7 @@ func (s *Service) Init(mesh servicemesh.Mesh) {
}
}

mesh.Events().On(events.EventServiceAdded, func(args ...any) {
mesh.Events().On(servicemesh.EventServiceAdded, func(args ...any) {
if len(args) < 1 {
return
}
Expand Down

0 comments on commit b1f2c93

Please sign in to comment.