Ejemplo n.º 1
0
func (k *kinesis) newClient(endpoint, stream string) gokinesis.KinesisClient {
	client := gokinesis.NewWithEndpoint(gokinesis.NewAuth("BAD_ACCESS_KEY", "BAD_SECRET_KEY", "BAD_TOKEN"), conf.AWS.Region, endpoint)
	client.CreateStream(stream, 1)

	// Wait for stream to create
	<-time.After(1 * time.Second)

	return client
}
Ejemplo n.º 2
0
func authenticate(accessKey, secretKey string) (auth *gokinesis.AuthCredentials, err error) {
	if accessKey == "" || secretKey == "" {
		if auth, err = gokinesis.NewAuthFromMetadata(); err != nil {
			return nil, ErrMetaAuthentication
		}
	} else {
		auth = gokinesis.NewAuth(accessKey, secretKey, "")
	}
	return
}