Skip to content

Commit

Permalink
Renamed function
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed May 16, 2024
1 parent 04b03fa commit 3ea7cb3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func New(ctx context.Context, m map[string]interface{}) (rgrpc.Service, error) {
service := &service{
conf: &c,
repo: repo,
ocmClient: ocmd.NewOCMClient(time.Duration(c.OCMClientTimeout)*time.Second, c.OCMClientInsecure),
ocmClient: ocmd.NewClient(time.Duration(c.OCMClientTimeout)*time.Second, c.OCMClientInsecure),
}
return service, nil
}
Expand Down
4 changes: 2 additions & 2 deletions internal/grpc/services/ocmshareprovider/ocmshareprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func New(ctx context.Context, m map[string]interface{}) (rgrpc.Service, error) {
}
walker := walker.NewWalker(gateway)

ocmcl := ocmd.NewOCMClient(time.Duration(c.ClientTimeout)*time.Second, c.ClientInsecure)
ocmcl := ocmd.NewClient(time.Duration(c.ClientTimeout)*time.Second, c.ClientInsecure)
service := &service{
conf: &c,
repo: repo,
Expand Down Expand Up @@ -175,7 +175,7 @@ func getResourceType(info *providerpb.ResourceInfo) string {

func (s *service) webdavURL(share *ocm.Share) string {
// the url is expected to be in the form https://ourserver/remote.php/dav/ocm/{ShareId}, see c.WebdavRoot in ocmprovider.go
// TODO(lopresti) take the root from http.services.ocmprovider's config
// TODO(lopresti) take the root from http.services.wellknown.ocmprovider's config
p, _ := url.JoinPath(s.conf.WebDAVEndpoint, "/remote.php/dav/ocm", share.Id.OpaqueId)
return p
}
Expand Down
4 changes: 2 additions & 2 deletions internal/http/services/opencloudmesh/ocmd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ type OCMClient struct {
client *http.Client
}

// NewOCMClient returns a new OCMClient.
func NewOCMClient(timeout time.Duration, insecure bool) *OCMClient {
// NewClient returns a new OCMClient.
func NewClient(timeout time.Duration, insecure bool) *OCMClient {
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: insecure},
}
Expand Down
2 changes: 1 addition & 1 deletion internal/http/services/opencloudmesh/ocmd/shares.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func discoverOcmWebdavRoot(r *http.Request) (string, error) {
log := appctx.GetLogger(ctx)
log.Debug().Str("sender", r.Host).Msg("received OCM 1.0 share, attempting to discover sender endpoint")

ocmClient := NewOCMClient(time.Duration(10)*time.Second, true)
ocmClient := NewClient(time.Duration(10)*time.Second, true)
ocmCaps, err := ocmClient.Discover(ctx, r.Host)
if err != nil {
log.Warn().Str("sender", r.Host).Err(err).Msg("failed to discover OCM sender")
Expand Down

0 comments on commit 3ea7cb3

Please sign in to comment.