github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/pkg/platform/api/mediator/mediator.go (about)

     1  package mediator
     2  
     3  import (
     4  	"github.com/ActiveState/cli/internal/gqlclient"
     5  	"github.com/ActiveState/cli/pkg/platform/api"
     6  	"github.com/ActiveState/cli/pkg/platform/authentication"
     7  )
     8  
     9  func New(auth *authentication.Auth) *gqlclient.Client {
    10  	url := api.GetServiceURL(api.ServiceMediator)
    11  	c := gqlclient.New(url.String(), 0)
    12  	if auth != nil {
    13  		c.SetTokenProvider(auth)
    14  	}
    15  	return c
    16  }