aws

package
v0.0.0-...-dffa276 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCacheClusterNotFound = errors.New("Cache cluster not found")
)

Functions

func Auth

func Auth() aws.Auth

Auth return the aws authentication.

func Bucket

func Bucket(connection *s3.S3, bucketName string) *s3.Bucket

Bucket get bucket of S3 via bucket name.

func Connection

func Connection(auth aws.Auth, region aws.Region) *s3.S3

Connection create connection of S3.

func DelFromMyBucket

func DelFromMyBucket(prefix string, keyname string) error

DelFromMyBucket delete a file from a bucket.

func DelFromMyTestBucket

func DelFromMyTestBucket(prefix string, keyname string) error

DelFromMyTestBucket delete a file from a bucket.

func List

func List(bucket *s3.Bucket, prefix, delim, marker string, max int) (*s3.ListResp, error)

List get list from bucket.

func MyBucket

func MyBucket() *s3.Bucket

MyBucket get bucket from config.

func MyBucketList

func MyBucketList(prefix, delim, marker string, max int) (*s3.ListResp, error)

MyBucketList get list from MyBucket.

func MyTestBucket

func MyTestBucket() *s3.Bucket

MyTestBucket get bucket from config.

func MyTestBucketList

func MyTestBucketList(prefix, delim, marker string, max int) (*s3.ListResp, error)

MyTestBucketList get list from MyBucket.

func PutToMyBucket

func PutToMyBucket(prefix string, keyname string, wb *bytes.Buffer, contentType string, aclType string) error

PutToMyBucket put a file to a bucket.

func PutToMyPrivateBucket

func PutToMyPrivateBucket(subdir string, keyname string, wb *bytes.Buffer, contentType string) error

PutToMyPrivateBucket put a file to the MyBucket.

func PutToMyPrivateTestBucket

func PutToMyPrivateTestBucket(subdir string, keyname string, wb *bytes.Buffer, contentType string) error

PutToMyPrivateTestBucket put a file to the MyBucket.

func PutToMyPublicBucket

func PutToMyPublicBucket(subdir string, keyname string, wb *bytes.Buffer, contentType string) error

PutToMyPublicBucket put a file to the MyBucket.

func PutToMyPublicTestBucket

func PutToMyPublicTestBucket(subdir string, keyname string, wb *bytes.Buffer, contentType string) error

PutToMyPublicTestBucket put a file to the MyBucket.

func PutToMyTestBucket

func PutToMyTestBucket(prefix string, keyname string, wb *bytes.Buffer, contentType string, aclType string) error

PutToMyTestBucket put a file to a bucket.

func Region

func Region(regionName string) aws.Region

Region return the aws region from string.

Types

type CacheCluster

type CacheCluster struct {
	CacheClusterId string       `xml:"CacheCluster>CacheClusterId"`
	CacheNodes     []*CacheNode `xml:"CacheCluster>CacheNodes"`
}

CacheCluster represents a cache cluster

type CacheNode

type CacheNode struct {
	Endpoint *Endpoint `xml:"CacheNode>Endpoint"`
}

CacheNode represents a cache node

type DescribeCacheClustersResult

type DescribeCacheClustersResult struct {
	CacheClusters []*CacheCluster `xml:"DescribeCacheClustersResult>CacheClusters"`
}

DescribeCacheClustersResult represents the response from a DescribeCacheClusters ElastiCache API call

type DescribeReplicationGroupsResult

type DescribeReplicationGroupsResult struct {
	ReplicationGroups []ReplicationGroup `xml:"DescribeReplicationGroupsResult>ReplicationGroups"`
}

DescribeReplicationGroupsResult represents the response

type ElastiCache

type ElastiCache struct {
	aws.Auth
	aws.Region
}

func NewElasticache

func NewElasticache() *ElastiCache

NewElasticache creates a new ElastiCache instance

func NewElasticacheWithParam

func NewElasticacheWithParam(auth aws.Auth, region aws.Region) *ElastiCache

NewElasticacheWithParam creates a new ElastiCache instance

func (*ElastiCache) DescribeCacheCluster

func (ec *ElastiCache) DescribeCacheCluster(cluster string) (*CacheCluster, error)

DescribeCacheCluster returns information about a cache cluster

func (*ElastiCache) DescribeReplicationGroup

func (ec *ElastiCache) DescribeReplicationGroup(groupName string) (*ReplicationGroup, error)

DescribeReplicationGroup returns information about a cache replication group

type Endpoint

type Endpoint struct {
	Host string `xml:"Address"`
	Port int    `xml:"Port"`
}

Endpoint represents a cache node endpoint

type Error

type Error struct {
	// HTTP status code
	StatusCode int
	// AWS error code
	Code string
	// The human-oriented error message
	Message string
}

Error encapsulates an error returned by EC.

func (*Error) Error

func (err *Error) Error() string

type NodeGroup

type NodeGroup struct {
	Status           string             `xml:"NodeGroup>Status"`
	PrimaryEndpoint  PrimaryEndpoint    `xml:"NodeGroup>PrimaryEndpoint"`
	NodeGroupMembers []*NodeGroupMember `xml:"NodeGroup>NodeGroupMembers>NodeGroupMember"`
}

NodeGroup represents a node group

type NodeGroupMember

type NodeGroupMember struct {
	CurrentRole               string       `xml:"CurrentRole"`
	PreferredAvailabilityZone string       `xml:"PreferredAvailabilityZone"`
	CacheNodeId               string       `xml:"CacheNodeId"`
	CacheClusterId            string       `xml:"CacheClusterId"`
	ReadEndpoint              ReadEndpoint `xml:"ReadEndpoint"`
}

NodeGroupMember represents an individual node

type PrimaryEndpoint

type PrimaryEndpoint struct {
	Port    int    `xml:"Port"`
	Address string `xml:"Address"`
}

PrimaryEndpoint represents the primary endpoint

type ReadEndpoint

type ReadEndpoint struct {
	Port    int    `xml:"Port"`
	Address string `xml:"Address"`
}

ReadEndpoint represents a read endpoint

type ReplicationGroup

type ReplicationGroup struct {
	Status             string      `xml:"ReplicationGroup>Status"`
	ReplicationGroupId string      `xml:"ReplicationGroup>ReplicationGroupId"`
	MemberClusters     []string    `xml:"ReplicationGroup>MemberClusters>ClusterId"`
	NodeGroups         []NodeGroup `xml:"ReplicationGroup>NodeGroups"`
}

ReplicationGroup represents a replication group

func (*ReplicationGroup) GetPrimaryNode

func (repGroup *ReplicationGroup) GetPrimaryNode() (*PrimaryEndpoint, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL