Documentation ¶
Index ¶
- func DoPost(url string, target string, request interface{}, response interface{}) error
- func FetchNewIdentityFor(poolID string) (string, error)
- func GetCredentialsFor(identity string) (*credentials.Credentials, error)
- func GetIdentityFor(poolID string) (string, error)
- func SetRegionURL(url string)
- type CustomCognitoCredentialsProvider
- type IdentityCredentials
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchNewIdentityFor ¶
FetchNewIdentityFor - see: https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_GetId.html#API_GetId_Examples
func GetCredentialsFor ¶
func GetCredentialsFor(identity string) (*credentials.Credentials, error)
GetCredentialsFor - Create a provider, and trigger the provider to fetch the credentials
func GetIdentityFor ¶
GetIdentityFor - If this is a new client, then we need to get a new identity from the configured pool. Once we have that we should cache that identity for later use.
func SetRegionURL ¶
func SetRegionURL(url string)
SetRegionURL - We need to target the correct AWS Cognito region. example: "https://cognito-identity.eu-west-1.amazonaws.com"
Types ¶
type CustomCognitoCredentialsProvider ¶
type CustomCognitoCredentialsProvider struct {
// contains filtered or unexported fields
}
CustomCognitoCredentialsProvider a small provider that supports Cognito identity pools
func (*CustomCognitoCredentialsProvider) IsExpired ¶
func (m *CustomCognitoCredentialsProvider) IsExpired() bool
IsExpired - ...
func (*CustomCognitoCredentialsProvider) Retrieve ¶
func (m *CustomCognitoCredentialsProvider) Retrieve() (credentials.Value, error)
Retrieve - ...
type IdentityCredentials ¶
type IdentityCredentials struct { Key string `json:"AccessKeyId"` Expires float64 `json:"Expiration"` Secret string `json:"SecretKey"` Token string `json:"SessionToken"` }
IdentityCredentials - ...
func FetchCredentialsFor ¶
func FetchCredentialsFor(identity string) (*IdentityCredentials, error)
FetchCredentialsFor - see: https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_GetCredentialsForIdentity.html