Documentation ¶
Index ¶
Constants ¶
const DefaultAtlasBaseURL = "https://cloud.mongodb.com"
DefaultAtlasBaseURL is the default atlas prod base url
const DefaultBaseURL = "https://stitch.mongodb.com"
DefaultBaseURL is the default prod base url for Stitch apps
Variables ¶
This section is empty.
Functions ¶
func UnmarshalStitchError ¶
UnmarshalStitchError unmarshals an *http.Response into an ErrStitchResponse. If the Body does not contain content it uses the provided Status
Types ¶
type AuthClient ¶
type AuthClient struct { Client // contains filtered or unexported fields }
AuthClient is a Client that is aware of a User's auth credentials
func NewAuthClient ¶
func NewAuthClient(client Client, user *user.User) *AuthClient
NewAuthClient returns a new *AuthClient
func (*AuthClient) ExecuteRequest ¶
func (ac *AuthClient) ExecuteRequest(method, path string, options RequestOptions) (*http.Response, error)
ExecuteRequest makes a call to the provided path, supplying the user's access token
func (*AuthClient) RefreshAuth ¶
func (ac *AuthClient) RefreshAuth() (auth.Response, error)
RefreshAuth makes a call to the session endpoint using the user's refresh token in order to obtain a new access token
type Client ¶
type Client interface {
ExecuteRequest(method, path string, options RequestOptions) (*http.Response, error)
}
Client represents something that is capable of making HTTP requests
type ErrAppNotFound ¶
type ErrAppNotFound struct {
ClientAppID string
}
ErrAppNotFound is used when an app cannot be found by client app ID
func (ErrAppNotFound) Error ¶
func (eanf ErrAppNotFound) Error() string
type ErrStitchResponse ¶
type ErrStitchResponse struct {
// contains filtered or unexported fields
}
ErrStitchResponse represents a response from a Stitch API call
func (ErrStitchResponse) Error ¶
func (esr ErrStitchResponse) Error() string
Error returns a stringified error message
func (*ErrStitchResponse) UnmarshalJSON ¶
func (esr *ErrStitchResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals JSON data into an ErrStitchResponse
type RequestOptions ¶
RequestOptions represents a simple set of options to use with HTTP requests
type StitchClient ¶
type StitchClient interface { Authenticate(authProvider auth.AuthenticationProvider) (*auth.Response, error) Export(groupID, appID string, isTemplated bool) (string, io.ReadCloser, error) Import(groupID, appID string, appData []byte, strategy string) error Diff(groupID, appID string, appData []byte, strategy string) ([]string, error) FetchAppByClientAppID(clientAppID string) (*models.App, error) FetchAppsByGroupID(groupID string) ([]*models.App, error) CreateEmptyApp(groupID, appName string) (*models.App, error) }
StitchClient represents a Client that can be used to call the Stitch Admin API
func NewStitchClient ¶
func NewStitchClient(client Client) StitchClient
NewStitchClient returns a new StitchClient to be used for making calls to the Stitch Admin API