将bucketname作为object_key的一部分;修改delete接口加入minioaddr和bucket可选参数。
This commit is contained in:
11
cache/include/cache_evbase_client.h
vendored
11
cache/include/cache_evbase_client.h
vendored
@@ -37,15 +37,16 @@ struct tango_cache_parameter *cache_evbase_parameter_new(const char* profile_pat
|
||||
/*<2A><><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>̰߳<DFB3>ȫ<EFBFBD><C8AB><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>߳<EFBFBD>*/
|
||||
struct cache_evbase_instance *cache_evbase_instance_new(struct tango_cache_parameter *param, void *runtimelog);
|
||||
|
||||
//GET<45>ӿڣ<D3BF><DAA3>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><30>ʧ<EFBFBD>ܷ<EFBFBD><DCB7><EFBFBD>-1<><31>future<72>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD><DFB3><EFBFBD>ִ<EFBFBD>У<EFBFBD><D0A3><EFBFBD>ͬ
|
||||
/******************************************* GET<45>ӿ<EFBFBD> ****************************************/
|
||||
//<2F>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><30>ʧ<EFBFBD>ܷ<EFBFBD><DCB7><EFBFBD>-1<><31>future<72>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD><DFB3><EFBFBD>ִ<EFBFBD>У<EFBFBD><D0A3><EFBFBD>ͬ
|
||||
int cache_evbase_fetch_object(struct cache_evbase_instance *instance, struct future* f, struct tango_cache_meta_get *meta, enum OBJECT_LOCATION where_to_get);
|
||||
int cache_evbase_head_object(struct cache_evbase_instance *instance, struct future* f, struct tango_cache_meta_get *meta);
|
||||
struct tango_cache_result *cache_evbase_read_result(void *promise_result);
|
||||
|
||||
//DELETE<54>ӿ<EFBFBD>
|
||||
int cache_evbase_delete_object(struct cache_evbase_instance *instance, struct future* f, const char *objkey);
|
||||
/****************************************** DELETE<54>ӿ<EFBFBD> **************************************/
|
||||
int cache_evbase_delete_object(struct cache_evbase_instance *instance, struct future* f, const char *objkey, const char *minio_addr=NULL, const char *bucket=NULL);
|
||||
|
||||
//һ<><D2BB><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4>ӿ<EFBFBD>
|
||||
/***************************************** һ<><D2BB><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4>ӿ<EFBFBD> **********************************/
|
||||
int cache_evbase_upload_once_data(struct cache_evbase_instance *instance, struct future* f,
|
||||
enum PUT_MEMORY_COPY_WAY way, const char *data, size_t size,
|
||||
struct tango_cache_meta_put *meta,
|
||||
@@ -55,7 +56,7 @@ int cache_evbase_upload_once_evbuf(struct cache_evbase_instance *instance, struc
|
||||
struct tango_cache_meta_put *meta,
|
||||
char *path/*OUT*/, size_t pathsize);
|
||||
|
||||
//<2F><>ʽ<EFBFBD>ϴ<EFBFBD><CFB4>ӿ<EFBFBD>
|
||||
/****************************************** <20><>ʽ<EFBFBD>ϴ<EFBFBD><CFB4>ӿ<EFBFBD> ***********************************/
|
||||
struct cache_evbase_ctx *cache_evbase_update_start(struct cache_evbase_instance *instance, struct future* f, struct tango_cache_meta_put *meta);
|
||||
int cache_evbase_update_frag_data(struct cache_evbase_ctx *ctx_asyn, enum PUT_MEMORY_COPY_WAY way, const char *data, size_t size);
|
||||
int cache_evbase_update_frag_evbuf(struct cache_evbase_ctx *ctx_asyn, struct evbuffer *evbuf);
|
||||
|
||||
2
cache/include/tango_cache_client.h
vendored
2
cache/include/tango_cache_client.h
vendored
@@ -111,7 +111,7 @@ struct tango_cache_result *tango_cache_read_result(future_result_t *promise_resu
|
||||
|
||||
|
||||
/****************************************** DELETE<54>ӿڵ<D3BF>API ******************************************/
|
||||
int tango_cache_delete_object(struct tango_cache_instance *instance, struct future* f, const char *objkey);
|
||||
int tango_cache_delete_object(struct tango_cache_instance *instance, struct future* f, const char *objkey, const char *minio_addr=NULL, const char *bucket=NULL);
|
||||
|
||||
|
||||
/****************************************** UPLOAD<41>ӿڵ<D3BF>API ******************************************/
|
||||
|
||||
47
cache/include/tango_cache_pending.h
vendored
47
cache/include/tango_cache_pending.h
vendored
@@ -1,48 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include<time.h>
|
||||
|
||||
enum tfe_http_std_field
|
||||
{
|
||||
TFE_HTTP_UNKNOWN_FIELD = 0,
|
||||
TFE_HTTP_HOST,
|
||||
TFE_HTTP_REFERER,
|
||||
TFE_HTTP_USER_AGENT,
|
||||
TFE_HTTP_COOKIE,
|
||||
TFE_HTTP_PROXY_AUTHORIZATION,
|
||||
TFE_HTTP_AUTHORIZATION,
|
||||
TFE_HTTP_LOCATION,
|
||||
TFE_HTTP_SERVER,
|
||||
TFE_HTTP_ETAG,
|
||||
TFE_HTTP_DATE,
|
||||
TFE_HTTP_TRAILER,
|
||||
TFE_HTTP_TRANSFER_ENCODING,
|
||||
TFE_HTTP_VIA,
|
||||
TFE_HTTP_PRAGMA,
|
||||
TFE_HTTP_CONNECTION,
|
||||
TFE_HTTP_CONT_ENCODING,
|
||||
TFE_HTTP_CONT_LANGUAGE,
|
||||
TFE_HTTP_CONT_LOCATION,
|
||||
TFE_HTTP_CONT_RANGE,
|
||||
TFE_HTTP_CONT_LENGTH,
|
||||
TFE_HTTP_CONT_TYPE,
|
||||
TFE_HTTP_CONT_DISPOSITION,
|
||||
TFE_HTTP_EXPIRES,
|
||||
TFE_HTTP_ACCEPT_ENCODING,
|
||||
TFE_HTTP_CACHE_CONTROL,
|
||||
TLF_HTTP_IF_MATCH,
|
||||
TLF_HTTP_IF_NONE_MATCH,
|
||||
TLF_HTTP_IF_MODIFIED_SINCE,
|
||||
TLF_HTTP_IF_UNMODIFIED_SINCE,
|
||||
TLF_HTTP_LAST_MODIFIED
|
||||
};
|
||||
|
||||
#include<tfe_http.h>
|
||||
|
||||
enum cache_pending_action {
|
||||
UNDEFINED = 0,
|
||||
ALLOWED,
|
||||
FORBIDDEN,
|
||||
VERIFY
|
||||
REVALIDATE
|
||||
};
|
||||
|
||||
|
||||
@@ -65,6 +30,8 @@ struct response_freshness{
|
||||
time_t timeout;
|
||||
};
|
||||
|
||||
|
||||
time_t read_GMT_time(const char* gmt_string);
|
||||
/*
|
||||
函数功能:
|
||||
根据请求头字段判断是否允许将缓存作为该请求的响应,并且将请求字段对缓存新鲜度的约束范围作为传出参数返回给调用者
|
||||
@@ -76,9 +43,9 @@ restrict:如果该函数返回值为ALLOWED,则返回请求Cache-Control字段
|
||||
UNDEFINED = 0,//请求字段中未定义缓存的行为
|
||||
ALLOWED ,//允许使用缓存作为该请求的响应
|
||||
FORBIDDEN,//禁止使用缓存作为该请求的响应,需要向源服务器请求
|
||||
VERIFY,//禁止使用未验证有效性的缓存作为该请求的响应
|
||||
REVALIDATE,//禁止使用未验证有效性的缓存作为该请求的响应
|
||||
*/
|
||||
enum cache_pending_action tfe_cache_get_pending(const struct tfe_http_field *request, size_t n_fields,struct request_freshness* restrict);
|
||||
enum cache_pending_action tfe_cache_get_pending(const struct tfe_http_half *request, struct request_freshness* restrict);
|
||||
|
||||
|
||||
|
||||
@@ -94,4 +61,4 @@ UNDEFINED = 0,//响应字段中未定义缓存的行为
|
||||
ALLOWED ,//允许缓存该响应
|
||||
FORBIDDEN,//禁止缓存该响应
|
||||
*/
|
||||
enum cache_pending_action tfe_cache_put_pending(const struct tfe_http_field *response, size_t n_fields, struct response_freshness* freshness);
|
||||
enum cache_pending_action tfe_cache_put_pending(const struct tfe_http_half *response, struct response_freshness* freshness);
|
||||
|
||||
Reference in New Issue
Block a user