Пример #1
0
/*
 *	Example:
 *	c := InitiateTempClient((consts)endPoint, tempAccessKeyId, tempAccessKeySecret, securityToken)
 */
func InitiateTempClient(endPoint, tempAccessKeyId, tempAccessKeySecret, securityToken, tempPrefix, tempDelimiter string) *Client {
	cc := common.NewClient(endPoint, tempAccessKeyId, tempAccessKeySecret)
	cc.TClient.UserProperty = "TempUser"
	cc.TClient.SecurityToken = securityToken
	if tempPrefix != "" {
		cc.TClient.TempPrefix = tempPrefix
	}
	if tempDelimiter != "" {
		cc.TClient.TempDelimiter = tempDelimiter
	}
	bc := bucket.Client{}
	mc := multipart.Client{}
	oc := object.Client{}
	sc := service.Client{}

	bc.CClient = cc
	mc.CClient = cc
	oc.CClient = cc
	sc.CClient = cc

	c := Client{
		BClient: &bc,
		MClient: &mc,
		OClient: &oc,
		SClient: &sc,
	}

	return &c
}
Пример #2
0
/*
 *	Example:
 *	c := InitiateClient((consts)endPoint, accessKeyId, accessKeySecret)
 */
func InitiateClient(endPoint, accessKeyId, accessKeySecret string) *Client {
	cc := common.NewClient(endPoint, accessKeyId, accessKeySecret)
	bc := bucket.Client{}
	mc := multipart.Client{}
	oc := object.Client{}
	sc := service.Client{}

	bc.CClient = cc
	mc.CClient = cc
	oc.CClient = cc
	sc.CClient = cc

	c := Client{
		BClient: &bc,
		MClient: &mc,
		OClient: &oc,
		SClient: &sc,
	}

	return &c
}