Skip to content

Commit

Permalink
Add HTTP to orchestrator interface. (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
daniilstrata authored Nov 28, 2024
1 parent 370f2cf commit c885ad4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions http/http.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package http

import "net/http"

// HTTP provides a way to interact with the HTTP client.
type HTTP interface {
// GetClient returns the HTTP client based on the provided name.
// If the client does not exist, an error will be returned.
GetClient(name string) (*http.Client, error)

// SetClient adds a client to the HTTP client store based on the provided name.
SetClient(name string, client *http.Client) error

// DefaultClient returns the default HTTP client.
DefaultClient() *http.Client
}
4 changes: 4 additions & 0 deletions orchestrator/orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/strata-io/service-extension/app"
"github.com/strata-io/service-extension/bundle"
"github.com/strata-io/service-extension/cache"
"github.com/strata-io/service-extension/http"
"github.com/strata-io/service-extension/idfabric"
"github.com/strata-io/service-extension/log"
"github.com/strata-io/service-extension/router"
Expand Down Expand Up @@ -65,4 +66,7 @@ type Orchestrator interface {
// ServiceExtensionAssets exposes any assets that may have been bundled with the
// service extension.
ServiceExtensionAssets() bundle.SEAssets

// HTTP provides utilities for making HTTP requests.
HTTP() http.HTTP
}

0 comments on commit c885ad4

Please sign in to comment.