Documentation ¶
Index ¶
- Constants
- func EntityMapAsModel(entityMap map[string]interface{}, model interface{}) error
- type AccessPolicy
- type CorsRule
- type CosmosPatchTransformPolicy
- type EndpointType
- type GeoReplication
- type GeoReplicationStatusType
- type Logging
- type MapOfInterfaceResponse
- type Metrics
- type OdataError
- type OdataErrorMessage
- type OdataMetadataFormat
- type QueryOptions
- type ResponseFormat
- type RetentionPolicy
- type ServiceGetPropertiesOptions
- type ServiceGetStatisticsOptions
- type ServiceSetPropertiesOptions
- type ServiceSetPropertiesResponse
- type SharedKeyCredential
- func (c *SharedKeyCredential) AccountName() string
- func (c *SharedKeyCredential) AuthenticationPolicy(azcore.AuthenticationPolicyOptions) azcore.Policy
- func (c *SharedKeyCredential) ComputeHMACSHA256(message string) (string, error)
- func (c *SharedKeyCredential) SetAccountKey(accountKey string) error
- type SignedIdentifier
- type SignedIdentifierArrayResponse
- type TableClient
- func (t *TableClient) AddEntity(ctx context.Context, entity interface{}) (TableInsertEntityResponse, error)
- func (t *TableClient) Create(ctx context.Context) (TableResponseResponse, error)
- func (t *TableClient) Delete(ctx context.Context) (TableDeleteResponse, error)
- func (t *TableClient) DeleteEntity(ctx context.Context, partitionKey string, rowKey string, etag string) (TableDeleteEntityResponse, error)
- func (t *TableClient) GetEntity(ctx context.Context, partitionKey string, rowKey string) (MapOfInterfaceResponse, error)
- func (t *TableClient) Query(queryOptions *QueryOptions) TableEntityQueryResponsePager
- func (t *TableClient) SubmitTransaction(ctx context.Context, transactionActions []TableTransactionAction, ...) (TableTransactionResponse, error)
- func (t *TableClient) UpdateEntity(ctx context.Context, entity map[string]interface{}, etag *string, ...) (interface{}, error)
- func (t *TableClient) UpsertEntity(ctx context.Context, entity map[string]interface{}, updateMode TableUpdateMode) (interface{}, error)
- type TableClientOptions
- type TableCreateOptions
- type TableCreateResponse
- type TableDeleteEntityOptions
- type TableDeleteEntityResponse
- type TableDeleteOptions
- type TableDeleteResponse
- type TableEntityQueryResponse
- type TableEntityQueryResponsePager
- type TableEntityQueryResponseResponse
- type TableGetAccessPolicyOptions
- type TableInsertEntityOptions
- type TableInsertEntityResponse
- type TableMergeEntityOptions
- type TableMergeEntityResponse
- type TableProperties
- type TableQueryEntitiesOptions
- type TableQueryEntityWithPartitionAndRowKeyOptions
- type TableQueryOptions
- type TableQueryResponse
- type TableQueryResponsePager
- type TableQueryResponseResponse
- type TableResponse
- type TableResponseProperties
- type TableResponseResponse
- type TableServiceClient
- func (t *TableServiceClient) Create(ctx context.Context, name string) (TableResponseResponse, error)
- func (t *TableServiceClient) Delete(ctx context.Context, name string) (TableDeleteResponse, error)
- func (t *TableServiceClient) NewTableClient(tableName string) *TableClient
- func (t *TableServiceClient) Query(queryOptions *QueryOptions) TableQueryResponsePager
- type TableServiceError
- type TableServiceProperties
- type TableServicePropertiesResponse
- type TableServiceStats
- type TableServiceStatsResponse
- type TableSetAccessPolicyOptions
- type TableSetAccessPolicyResponse
- type TableSubmitTransactionOptions
- type TableTransactionAction
- type TableTransactionActionType
- type TableTransactionError
- type TableTransactionResponse
- type TableUpdateEntityOptions
- type TableUpdateEntityResponse
- type TableUpdateMode
Constants ¶
const ( LegacyCosmosTableDomain = ".table.cosmosdb." CosmosTableDomain = ".table.cosmos." )
const ( OdataType = "@odata.type" ISO8601 = "2006-01-02T15:04:05.9999999Z" )
nolint
const ( DefaultStorageSuffix = "core.windows.net" DefaultCosmosSuffix = "cosmos.azure.com" )
Variables ¶
This section is empty.
Functions ¶
func EntityMapAsModel ¶
EntityMapAsModel converts a table entity in the form of map[string]interface{} and converts it to a strongly typed model.
Example: mapEntity, err := client.GetEntity("somePartition", "someRow") myEntityModel := MyModel{} err = EntityMapAsModel(mapEntity, &myEntityModel)
Types ¶
type AccessPolicy ¶
type AccessPolicy struct { // REQUIRED; The datetime that the policy expires. Expiry *time.Time `xml:"Expiry"` // REQUIRED; The permissions for the acl policy. Permission *string `xml:"Permission"` // REQUIRED; The start datetime from which the policy is active. Start *time.Time `xml:"Start"` }
AccessPolicy - An Access policy.
func (AccessPolicy) MarshalXML ¶
func (a AccessPolicy) MarshalXML(e *xml.Encoder, start xml.StartElement) error
MarshalXML implements the xml.Marshaller interface for type AccessPolicy.
func (*AccessPolicy) UnmarshalXML ¶
func (a *AccessPolicy) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
UnmarshalXML implements the xml.Unmarshaller interface for type AccessPolicy.
type CorsRule ¶
type CorsRule struct { // REQUIRED; The request headers that the origin domain may specify on the CORS request. AllowedHeaders *string `xml:"AllowedHeaders"` // REQUIRED; The methods (HTTP request verbs) that the origin domain may use for a CORS request. (comma separated) AllowedMethods *string `xml:"AllowedMethods"` // REQUIRED; The origin domains that are permitted to make a request against the service via CORS. The origin domain is the domain from which the request // originates. Note that the origin must be an exact // case-sensitive match with the origin that the user age sends to the service. You can also use the wildcard character '*' to allow all origin domains // to make requests via CORS. AllowedOrigins *string `xml:"AllowedOrigins"` // REQUIRED; The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer. ExposedHeaders *string `xml:"ExposedHeaders"` // REQUIRED; The maximum amount time that a browser should cache the preflight OPTIONS request. MaxAgeInSeconds *int32 `xml:"MaxAgeInSeconds"` }
CorsRule - CORS is an HTTP feature that enables a web application running under one domain to access resources in another domain. Web browsers implement a security restriction known as same-origin policy that prevents a web page from calling APIs in a different domain; CORS provides a secure way to allow one domain (the origin domain) to call APIs in another domain.
type CosmosPatchTransformPolicy ¶
type CosmosPatchTransformPolicy struct{}
CosmosPatchTransformPolicy transforms PATCH requests into POST requests with the "X-HTTP-Method":"MERGE" header set.
type EndpointType ¶
type EndpointType string
const ( StorageEndpoint EndpointType = "storage" CosmosEndpoint EndpointType = "cosmos" )
type GeoReplication ¶
type GeoReplication struct { // REQUIRED; A GMT date/time value, to the second. All primary writes preceding this value are guaranteed to be available for read operations at the secondary. // Primary writes after this point in time may or may // not be available for reads. LastSyncTime *time.Time `xml:"LastSyncTime"` // REQUIRED; The status of the secondary location. Status *GeoReplicationStatusType `xml:"Status"` }
func (GeoReplication) MarshalXML ¶
func (g GeoReplication) MarshalXML(e *xml.Encoder, start xml.StartElement) error
MarshalXML implements the xml.Marshaller interface for type GeoReplication.
func (*GeoReplication) UnmarshalXML ¶
func (g *GeoReplication) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
UnmarshalXML implements the xml.Unmarshaller interface for type GeoReplication.
type GeoReplicationStatusType ¶
type GeoReplicationStatusType string
GeoReplicationStatusType - The status of the secondary location.
const ( GeoReplicationStatusTypeBootstrap GeoReplicationStatusType = "bootstrap" GeoReplicationStatusTypeLive GeoReplicationStatusType = "live" )
func PossibleGeoReplicationStatusTypeValues ¶
func PossibleGeoReplicationStatusTypeValues() []GeoReplicationStatusType
PossibleGeoReplicationStatusTypeValues returns the possible values for the GeoReplicationStatusType const type.
func (GeoReplicationStatusType) ToPtr ¶
func (c GeoReplicationStatusType) ToPtr() *GeoReplicationStatusType
ToPtr returns a *GeoReplicationStatusType pointing to the current value.
type Logging ¶
type Logging struct { // REQUIRED; Indicates whether all delete requests should be logged. Delete *bool `xml:"Delete"` // REQUIRED; Indicates whether all read requests should be logged. Read *bool `xml:"Read"` // REQUIRED; The retention policy. RetentionPolicy *RetentionPolicy `xml:"RetentionPolicy"` // REQUIRED; The version of Analytics to configure. Version *string `xml:"Version"` // REQUIRED; Indicates whether all write requests should be logged. Write *bool `xml:"Write"` }
Logging - Azure Analytics Logging settings.
type MapOfInterfaceResponse ¶
type MapOfInterfaceResponse struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string // ContentType contains the information returned from the Content-Type header response. ContentType *string // Date contains the information returned from the Date header response. Date *time.Time // ETag contains the information returned from the ETag header response. ETag *string // PreferenceApplied contains the information returned from the Preference-Applied header response. PreferenceApplied *string // RawResponse contains the underlying HTTP response. RawResponse *http.Response // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string // The other properties of the table entity. Value map[string]interface{} // Version contains the information returned from the x-ms-version header response. Version *string // XMSContinuationNextPartitionKey contains the information returned from the x-ms-continuation-NextPartitionKey header response. XMSContinuationNextPartitionKey *string // XMSContinuationNextRowKey contains the information returned from the x-ms-continuation-NextRowKey header response. XMSContinuationNextRowKey *string }
MapOfInterfaceResponse is the response envelope for operations that return a map[string]interface{} type.
type Metrics ¶
type Metrics struct { // REQUIRED; Indicates whether metrics are enabled for the Table service. Enabled *bool `xml:"Enabled"` // Indicates whether metrics should generate summary statistics for called API operations. IncludeAPIs *bool `xml:"IncludeAPIs"` // The retention policy. RetentionPolicy *RetentionPolicy `xml:"RetentionPolicy"` // The version of Analytics to configure. Version *string `xml:"Version"` }
type OdataError ¶
type OdataError struct { Code string `json:"code"` Message OdataErrorMessage `json:"message"` }
type OdataErrorMessage ¶
type OdataMetadataFormat ¶
type OdataMetadataFormat string
const ( OdataMetadataFormatApplicationJSONOdataFullmetadata OdataMetadataFormat = "application/json;odata=fullmetadata" OdataMetadataFormatApplicationJSONOdataMinimalmetadata OdataMetadataFormat = "application/json;odata=minimalmetadata" OdataMetadataFormatApplicationJSONOdataNometadata OdataMetadataFormat = "application/json;odata=nometadata" )
func PossibleOdataMetadataFormatValues ¶
func PossibleOdataMetadataFormatValues() []OdataMetadataFormat
PossibleOdataMetadataFormatValues returns the possible values for the OdataMetadataFormat const type.
func (OdataMetadataFormat) ToPtr ¶
func (c OdataMetadataFormat) ToPtr() *OdataMetadataFormat
ToPtr returns a *OdataMetadataFormat pointing to the current value.
type QueryOptions ¶
type QueryOptions struct { // OData filter expression. Filter *string // Specifies the media type for the response. Format *OdataMetadataFormat // Select expression using OData notation. Limits the columns on each record to just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Select *string // Maximum number of records to return. Top *int32 }
QueryOptions contains a group of parameters for the Table.Query method.
type ResponseFormat ¶
type ResponseFormat string
const ( ResponseFormatReturnContent ResponseFormat = "return-content" ResponseFormatReturnNoContent ResponseFormat = "return-no-content" )
func PossibleResponseFormatValues ¶
func PossibleResponseFormatValues() []ResponseFormat
PossibleResponseFormatValues returns the possible values for the ResponseFormat const type.
func (ResponseFormat) ToPtr ¶
func (c ResponseFormat) ToPtr() *ResponseFormat
ToPtr returns a *ResponseFormat pointing to the current value.
type RetentionPolicy ¶
type RetentionPolicy struct { // REQUIRED; Indicates whether a retention policy is enabled for the service. Enabled *bool `xml:"Enabled"` // Indicates the number of days that metrics or logging or soft-deleted data should be retained. All data older than this value will be deleted. Days *int32 `xml:"Days"` }
RetentionPolicy - The retention policy.
type ServiceGetPropertiesOptions ¶
type ServiceGetPropertiesOptions struct { // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. RequestID *string // The timeout parameter is expressed in seconds. Timeout *int32 }
ServiceGetPropertiesOptions contains the optional parameters for the Service.GetProperties method.
type ServiceGetStatisticsOptions ¶
type ServiceGetStatisticsOptions struct { // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. RequestID *string // The timeout parameter is expressed in seconds. Timeout *int32 }
ServiceGetStatisticsOptions contains the optional parameters for the Service.GetStatistics method.
type ServiceSetPropertiesOptions ¶
type ServiceSetPropertiesOptions struct { // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. RequestID *string // The timeout parameter is expressed in seconds. Timeout *int32 }
ServiceSetPropertiesOptions contains the optional parameters for the Service.SetProperties method.
type ServiceSetPropertiesResponse ¶
type ServiceSetPropertiesResponse struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string // RawResponse contains the underlying HTTP response. RawResponse *http.Response // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string // Version contains the information returned from the x-ms-version header response. Version *string }
ServiceSetPropertiesResponse contains the response from method Service.SetProperties.
type SharedKeyCredential ¶
type SharedKeyCredential struct {
// contains filtered or unexported fields
}
SharedKeyCredential contains an account's name and its primary or secondary key. It is immutable making it shareable and goroutine-safe.
func NewSharedKeyCredential ¶
func NewSharedKeyCredential(accountName, accountKey string) (*SharedKeyCredential, error)
NewSharedKeyCredential creates an immutable SharedKeyCredential containing the storage account's name and either its primary or secondary key.
func (*SharedKeyCredential) AccountName ¶
func (c *SharedKeyCredential) AccountName() string
AccountName returns the Storage account's name.
func (*SharedKeyCredential) AuthenticationPolicy ¶
func (c *SharedKeyCredential) AuthenticationPolicy(azcore.AuthenticationPolicyOptions) azcore.Policy
AuthenticationPolicy implements the Credential interface on SharedKeyCredential.
func (*SharedKeyCredential) ComputeHMACSHA256 ¶
func (c *SharedKeyCredential) ComputeHMACSHA256(message string) (string, error)
computeHMACSHA256 generates a hash signature for an HTTP request or for a SAS.
func (*SharedKeyCredential) SetAccountKey ¶
func (c *SharedKeyCredential) SetAccountKey(accountKey string) error
SetAccountKey replaces the existing account key with the specified account key.
type SignedIdentifier ¶
type SignedIdentifier struct { // REQUIRED; The access policy. AccessPolicy *AccessPolicy `xml:"AccessPolicy"` // REQUIRED; A unique id. ID *string `xml:"Id"` }
SignedIdentifier - A signed identifier.
type SignedIdentifierArrayResponse ¶
type SignedIdentifierArrayResponse struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string `xml:"ClientRequestID"` // Date contains the information returned from the Date header response. Date *time.Time `xml:"Date"` // RawResponse contains the underlying HTTP response. RawResponse *http.Response // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string `xml:"RequestID"` // A collection of signed identifiers. SignedIdentifiers []*SignedIdentifier `xml:"SignedIdentifier"` // Version contains the information returned from the x-ms-version header response. Version *string `xml:"Version"` }
SignedIdentifierArrayResponse is the response envelope for operations that return a []*SignedIdentifier type.
type TableClient ¶
type TableClient struct { Name string // contains filtered or unexported fields }
A TableClient represents a client to the tables service affinitized to a specific table.
func NewTableClient ¶
func NewTableClient(tableName string, serviceURL string, cred azcore.Credential, options *TableClientOptions) (*TableClient, error)
NewTableClient creates a TableClient struct in the context of the table specified in tableName, using the specified serviceURL, credential, and options.
func (*TableClient) AddEntity ¶
func (t *TableClient) AddEntity(ctx context.Context, entity interface{}) (TableInsertEntityResponse, error)
AddEntity adds an entity from an arbitrary interface value to the table. An entity must have at least a PartitionKey and RowKey property.
func (*TableClient) Create ¶
func (t *TableClient) Create(ctx context.Context) (TableResponseResponse, error)
Create creates the table with the tableName specified when NewTableClient was called.
func (*TableClient) Delete ¶
func (t *TableClient) Delete(ctx context.Context) (TableDeleteResponse, error)
Delete deletes the table with the tableName specified when NewTableClient was called.
func (*TableClient) DeleteEntity ¶
func (t *TableClient) DeleteEntity(ctx context.Context, partitionKey string, rowKey string, etag string) (TableDeleteEntityResponse, error)
DeleteEntity deletes the entity with the specified partitionKey and rowKey from the table.
func (*TableClient) GetEntity ¶
func (t *TableClient) GetEntity(ctx context.Context, partitionKey string, rowKey string) (MapOfInterfaceResponse, error)
GetEntity retrieves a specific entity from the service using the specified partitionKey and rowKey values.
func (*TableClient) Query ¶
func (t *TableClient) Query(queryOptions *QueryOptions) TableEntityQueryResponsePager
Query queries the tables using the specified QueryOptions. QueryOptions can specify the following properties to affect the query results returned:
Filter: An Odata filter expression that limits results to those entities that satisfy the filter expression. For example, the following expression would return only entities with a PartitionKey of 'foo': "PartitionKey eq 'foo'"
Select: A comma delimited list of entity property names that selects which set of entity properties to return in the result set. For example, the following value would return results containing only the PartitionKey and RowKey properties: "PartitionKey, RowKey"
Top: The maximum number of entities that will be returned per page of results. Note: This value does not limit the total number of results if NextPage is called on the returned Pager until it returns false.
Query returns a Pager, which allows iteration through each page of results. Example:
pager := client.Query(nil)
for pager.NextPage(ctx) { resp = pager.PageResponse() fmt.sprintf("The page contains %i results", len(resp.TableEntityQueryResponse.Value)) }
err := pager.Err()
func (*TableClient) SubmitTransaction ¶
func (t *TableClient) SubmitTransaction(ctx context.Context, transactionActions []TableTransactionAction, tableSubmitTransactionOptions *TableSubmitTransactionOptions) (TableTransactionResponse, error)
SubmitTransaction submits the table transactional batch according to the slice of TableTransactionActions provided.
func (*TableClient) UpdateEntity ¶
func (t *TableClient) UpdateEntity(ctx context.Context, entity map[string]interface{}, etag *string, updateMode TableUpdateMode) (interface{}, error)
UpdateEntity updates the specified table entity if it exists. If updateMode is Replace, the entity will be replaced. This is the only way to remove properties from an existing entity. If updateMode is Merge, the property values present in the specified entity will be merged with the existing entity. Properties not specified in the merge will be unaffected. The specified etag value will be used for optimistic concurrency. If the etag does not match the value of the entity in the table, the operation will fail. The response type will be TableEntityMergeResponse if updateMode is Merge and TableEntityUpdateResponse if updateMode is Replace.
func (*TableClient) UpsertEntity ¶
func (t *TableClient) UpsertEntity(ctx context.Context, entity map[string]interface{}, updateMode TableUpdateMode) (interface{}, error)
UpsertEntity replaces the specified table entity if it exists or creates the entity if it does not exist. If the entity exists and updateMode is Merge, the property values present in the specified entity will be merged with the existing entity rather than replaced. The response type will be TableEntityMergeResponse if updateMode is Merge and TableEntityUpdateResponse if updateMode is Replace.
type TableClientOptions ¶
type TableClientOptions struct { // HTTPClient sets the transport for making HTTP requests. HTTPClient azcore.Transport // Retry configures the built-in retry policy behavior. Retry azcore.RetryOptions // Telemetry configures the built-in telemetry policy behavior. Telemetry azcore.TelemetryOptions }
type TableCreateOptions ¶
type TableCreateOptions struct { // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. RequestID *string // Specifies whether the response should include the inserted entity in the payload. Possible values are return-no-content and return-content. ResponsePreference *ResponseFormat }
TableCreateOptions contains the optional parameters for the Table.Create method.
type TableCreateResponse ¶
type TableCreateResponse struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string // Date contains the information returned from the Date header response. Date *time.Time // PreferenceApplied contains the information returned from the Preference-Applied header response. PreferenceApplied *string // RawResponse contains the underlying HTTP response. RawResponse *http.Response // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string // Version contains the information returned from the x-ms-version header response. Version *string }
TableCreateResponse contains the response from method Table.Create.
type TableDeleteEntityOptions ¶
type TableDeleteEntityOptions struct { // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. RequestID *string // The timeout parameter is expressed in seconds. Timeout *int32 }
TableDeleteEntityOptions contains the optional parameters for the Table.DeleteEntity method.
type TableDeleteEntityResponse ¶
type TableDeleteEntityResponse struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string // Date contains the information returned from the Date header response. Date *time.Time // RawResponse contains the underlying HTTP response. RawResponse *http.Response // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string // Version contains the information returned from the x-ms-version header response. Version *string }
TableDeleteEntityResponse contains the response from method Table.DeleteEntity.
type TableDeleteOptions ¶
type TableDeleteOptions struct { // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. RequestID *string }
TableDeleteOptions contains the optional parameters for the Table.Delete method.
type TableDeleteResponse ¶
type TableDeleteResponse struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string // Date contains the information returned from the Date header response. Date *time.Time // RawResponse contains the underlying HTTP response. RawResponse *http.Response // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string // Version contains the information returned from the x-ms-version header response. Version *string }
TableDeleteResponse contains the response from method Table.Delete.
type TableEntityQueryResponse ¶
type TableEntityQueryResponse struct { // The metadata response of the table. OdataMetadata *string `json:"odata.metadata,omitempty"` // List of table entities. Value []map[string]interface{} `json:"value,omitempty"` }
TableEntityQueryResponse - The properties for the table entity query response.
func (*TableEntityQueryResponse) AsModels ¶
func (r *TableEntityQueryResponse) AsModels(modelSlice interface{}) error
AsModels converts each map[string]interface{} entity result into a strongly slice of strongly typed models The modelSlice parameter should be a pointer to a slice of struct types that match the entity model type in the table response.
func (TableEntityQueryResponse) MarshalJSON ¶
func (t TableEntityQueryResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TableEntityQueryResponse.
type TableEntityQueryResponsePager ¶
type TableEntityQueryResponsePager interface { azcore.Pager // PageResponse returns the current TableQueryResponseResponse. PageResponse() TableEntityQueryResponseResponse }
TableEntityQueryResponsePager is a Pager for Table entity query results.
NextPage should be called first. It fetches the next available page of results from the service. If the fetched page contains results, the return value is true, else false. Results fetched from the service can be evaluated by calling PageResponse on this Pager. If the result is false, the value of Err() will indicate if an error occurred.
PageResponse returns the results from the page most recently fetched from the service. Example usage of this in combination with NextPage would look like the following:
for pager.NextPage(ctx) { resp = pager.PageResponse() fmt.sprintf("The page contains %i results", len(resp.TableEntityQueryResponse.Value)) }
err := pager.Err()
type TableEntityQueryResponseResponse ¶
type TableEntityQueryResponseResponse struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string // Date contains the information returned from the Date header response. Date *time.Time // RawResponse contains the underlying HTTP response. RawResponse *http.Response // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string // The properties for the table entity query response. TableEntityQueryResponse *TableEntityQueryResponse // Version contains the information returned from the x-ms-version header response. Version *string // XMSContinuationNextPartitionKey contains the information returned from the x-ms-continuation-NextPartitionKey header response. XMSContinuationNextPartitionKey *string // XMSContinuationNextRowKey contains the information returned from the x-ms-continuation-NextRowKey header response. XMSContinuationNextRowKey *string }
TableEntityQueryResponseResponse is the response envelope for operations that return a TableEntityQueryResponse type.
type TableGetAccessPolicyOptions ¶
type TableGetAccessPolicyOptions struct { // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. RequestID *string // The timeout parameter is expressed in seconds. Timeout *int32 }
TableGetAccessPolicyOptions contains the optional parameters for the Table.GetAccessPolicy method.
type TableInsertEntityOptions ¶
type TableInsertEntityOptions struct { // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. RequestID *string // Specifies whether the response should include the inserted entity in the payload. Possible values are return-no-content and return-content. ResponsePreference *ResponseFormat // The properties for the table entity. TableEntityProperties map[string]interface{} // The timeout parameter is expressed in seconds. Timeout *int32 }
TableInsertEntityOptions contains the optional parameters for the Table.InsertEntity method.
type TableInsertEntityResponse ¶
type TableInsertEntityResponse struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string // ContentType contains the information returned from the Content-Type header response. ContentType *string // Date contains the information returned from the Date header response. Date *time.Time // ETag contains the information returned from the ETag header response. ETag *string // PreferenceApplied contains the information returned from the Preference-Applied header response. PreferenceApplied *string // RawResponse contains the underlying HTTP response. RawResponse *http.Response // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string // Version contains the information returned from the x-ms-version header response. Version *string }
TableInsertEntityResponse contains the response from method Table.InsertEntity.
type TableMergeEntityOptions ¶
type TableMergeEntityOptions struct { // Match condition for an entity to be updated. If specified and a matching entity is not found, an error will be raised. To force an unconditional update, // set to the wildcard character (*). If not specified, an insert will be performed when no existing entity is found to update and a merge will be performed // if an existing entity is found. IfMatch *string // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. RequestID *string // The properties for the table entity. TableEntityProperties map[string]interface{} // The timeout parameter is expressed in seconds. Timeout *int32 }
TableMergeEntityOptions contains the optional parameters for the Table.MergeEntity method.
type TableMergeEntityResponse ¶
type TableMergeEntityResponse struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string // Date contains the information returned from the Date header response. Date *time.Time // ETag contains the information returned from the ETag header response. ETag *string // RawResponse contains the underlying HTTP response. RawResponse *http.Response // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string // Version contains the information returned from the x-ms-version header response. Version *string }
TableMergeEntityResponse contains the response from method Table.MergeEntity.
type TableProperties ¶
type TableProperties struct { // The name of the table to create. TableName *string `json:"TableName,omitempty"` }
TableProperties - The properties for creating a table.
type TableQueryEntitiesOptions ¶
type TableQueryEntitiesOptions struct { // An entity query continuation token from a previous call. NextPartitionKey *string // An entity query continuation token from a previous call. NextRowKey *string // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. RequestID *string // The timeout parameter is expressed in seconds. Timeout *int32 }
TableQueryEntitiesOptions contains the optional parameters for the Table.QueryEntities method.
type TableQueryEntityWithPartitionAndRowKeyOptions ¶
type TableQueryEntityWithPartitionAndRowKeyOptions struct { // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. RequestID *string // The timeout parameter is expressed in seconds. Timeout *int32 }
TableQueryEntityWithPartitionAndRowKeyOptions contains the optional parameters for the Table.QueryEntityWithPartitionAndRowKey method.
type TableQueryOptions ¶
type TableQueryOptions struct { // A table query continuation token from a previous call. NextTableName *string // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. RequestID *string }
TableQueryOptions contains the optional parameters for the Table.Query method.
type TableQueryResponse ¶
type TableQueryResponse struct { // The metadata response of the table. OdataMetadata *string `json:"odata.metadata,omitempty"` // List of tables. Value []*TableResponseProperties `json:"value,omitempty"` }
TableQueryResponse - The properties for the table query response.
func (TableQueryResponse) MarshalJSON ¶
func (t TableQueryResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TableQueryResponse.
type TableQueryResponsePager ¶
type TableQueryResponsePager interface { azcore.Pager // PageResponse returns the current TableQueryResponseResponse. PageResponse() TableQueryResponseResponse }
TableQueryResponsePager is a Pager for Table Queries
NextPage should be called first. It fetches the next available page of results from the service. If the fetched page contains results, the return value is true, else false. Results fetched from the service can be evaluated by calling PageResponse on this Pager. If the result is false, the value of Err() will indicate if an error occurred.
PageResponse returns the results from the page most recently fetched from the service. Example usage of this in combination with NextPage would look like the following:
for pager.NextPage(ctx) { resp = pager.PageResponse() fmt.sprintf("The page contains %i results", len(resp.TableEntityQueryResponse.Value)) }
err := pager.Err()
type TableQueryResponseResponse ¶
type TableQueryResponseResponse struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string // Date contains the information returned from the Date header response. Date *time.Time // RawResponse contains the underlying HTTP response. RawResponse *http.Response // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string // The properties for the table query response. TableQueryResponse *TableQueryResponse // Version contains the information returned from the x-ms-version header response. Version *string // XMSContinuationNextTableName contains the information returned from the x-ms-continuation-NextTableName header response. XMSContinuationNextTableName *string }
TableQueryResponseResponse is the response envelope for operations that return a TableQueryResponse type.
type TableResponse ¶
type TableResponse struct { TableResponseProperties // The metadata response of the table. OdataMetadata *string `json:"odata.metadata,omitempty"` }
TableResponse - The response for a single table.
type TableResponseProperties ¶
type TableResponseProperties struct { // The edit link of the table. OdataEditLink *string `json:"odata.editLink,omitempty"` // The id of the table. OdataID *string `json:"odata.id,omitempty"` // The odata type of the table. OdataType *string `json:"odata.type,omitempty"` // The name of the table. TableName *string `json:"TableName,omitempty"` }
TableResponseProperties - The properties for the table response.
type TableResponseResponse ¶
type TableResponseResponse struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string // Date contains the information returned from the Date header response. Date *time.Time // PreferenceApplied contains the information returned from the Preference-Applied header response. PreferenceApplied *string // RawResponse contains the underlying HTTP response. RawResponse *http.Response // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string // The response for a single table. TableResponse *TableResponse // Version contains the information returned from the x-ms-version header response. Version *string }
TableResponseResponse is the response envelope for operations that return a TableResponse type.
type TableServiceClient ¶
type TableServiceClient struct {
// contains filtered or unexported fields
}
A TableServiceClient represents a client to the table service. It can be used to query the available tables, add/remove tables, and various other service level operations.
func NewTableServiceClient ¶
func NewTableServiceClient(serviceURL string, cred azcore.Credential, options *TableClientOptions) (*TableServiceClient, error)
NewTableServiceClient creates a TableServiceClient struct using the specified serviceURL, credential, and options.
func (*TableServiceClient) Create ¶
func (t *TableServiceClient) Create(ctx context.Context, name string) (TableResponseResponse, error)
Create creates a table with the specified name.
func (*TableServiceClient) Delete ¶
func (t *TableServiceClient) Delete(ctx context.Context, name string) (TableDeleteResponse, error)
Delete deletes a table by name.
func (*TableServiceClient) NewTableClient ¶
func (t *TableServiceClient) NewTableClient(tableName string) *TableClient
NewTableClient returns a pointer to a TableClient affinitzed to the specified table name and initialized with the same serviceURL and credentials as this TableServiceClient
func (*TableServiceClient) Query ¶
func (t *TableServiceClient) Query(queryOptions *QueryOptions) TableQueryResponsePager
Query queries the existing tables using the specified QueryOptions. QueryOptions can specify the following properties to affect the query results returned:
Filter: An Odata filter expression that limits results to those tables that satisfy the filter expression. For example, the following expression would return only tables with a TableName of 'foo': "TableName eq 'foo'"
Top: The maximum number of tables that will be returned per page of results. Note: This value does not limit the total number of results if NextPage is called on the returned Pager until it returns false.
Query returns a Pager, which allows iteration through each page of results. Example:
pager := client.Query(nil)
for pager.NextPage(ctx) { resp = pager.PageResponse() fmt.sprintf("The page contains %i results", len(resp.TableQueryResponse.Value)) }
err := pager.Err()
type TableServiceError ¶
type TableServiceError struct { // The error message. Message *string `json:"Message,omitempty"` // contains filtered or unexported fields }
TableServiceError - Table Service error. Implements the error and azcore.HTTPResponse interfaces.
func (TableServiceError) Error ¶
func (e TableServiceError) Error() string
Error implements the error interface for type TableServiceError. The contents of the error text are not contractual and subject to change.
type TableServiceProperties ¶
type TableServiceProperties struct { // The set of CORS rules. Cors []*CorsRule `xml:"Cors>CorsRule"` // A summary of request statistics grouped by API in hourly aggregates for tables. HourMetrics *Metrics `xml:"HourMetrics"` // Azure Analytics Logging settings. Logging *Logging `xml:"Logging"` // A summary of request statistics grouped by API in minute aggregates for tables. MinuteMetrics *Metrics `xml:"MinuteMetrics"` }
TableServiceProperties - Table Service Properties.
func (TableServiceProperties) MarshalXML ¶
func (t TableServiceProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error
MarshalXML implements the xml.Marshaller interface for type TableServiceProperties.
type TableServicePropertiesResponse ¶
type TableServicePropertiesResponse struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string `xml:"ClientRequestID"` // RawResponse contains the underlying HTTP response. RawResponse *http.Response // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string `xml:"RequestID"` // Table Service Properties. StorageServiceProperties *TableServiceProperties `xml:"StorageServiceProperties"` // Version contains the information returned from the x-ms-version header response. Version *string `xml:"Version"` }
TableServicePropertiesResponse is the response envelope for operations that return a TableServiceProperties type.
type TableServiceStats ¶
type TableServiceStats struct { // Geo-Replication information for the Secondary Storage Service. GeoReplication *GeoReplication `xml:"GeoReplication"` }
TableServiceStats - Stats for the service.
type TableServiceStatsResponse ¶
type TableServiceStatsResponse struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string `xml:"ClientRequestID"` // Date contains the information returned from the Date header response. Date *time.Time `xml:"Date"` // RawResponse contains the underlying HTTP response. RawResponse *http.Response // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string `xml:"RequestID"` // Stats for the service. StorageServiceStats *TableServiceStats `xml:"StorageServiceStats"` // Version contains the information returned from the x-ms-version header response. Version *string `xml:"Version"` }
TableServiceStatsResponse is the response envelope for operations that return a TableServiceStats type.
type TableSetAccessPolicyOptions ¶
type TableSetAccessPolicyOptions struct { // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. RequestID *string // The acls for the table. TableACL []*SignedIdentifier // The timeout parameter is expressed in seconds. Timeout *int32 }
TableSetAccessPolicyOptions contains the optional parameters for the Table.SetAccessPolicy method.
type TableSetAccessPolicyResponse ¶
type TableSetAccessPolicyResponse struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string // Date contains the information returned from the Date header response. Date *time.Time // RawResponse contains the underlying HTTP response. RawResponse *http.Response // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string // Version contains the information returned from the x-ms-version header response. Version *string }
TableSetAccessPolicyResponse contains the response from method Table.SetAccessPolicy.
type TableSubmitTransactionOptions ¶
type TableSubmitTransactionOptions struct {
RequestID *string
}
type TableTransactionAction ¶
type TableTransactionAction struct { ActionType TableTransactionActionType Entity map[string]interface{} ETag string }
type TableTransactionActionType ¶
type TableTransactionActionType string
const ( Add TableTransactionActionType = "add" UpdateMerge TableTransactionActionType = "updatemerge" UpdateReplace TableTransactionActionType = "updatereplace" Delete TableTransactionActionType = "delete" UpsertMerge TableTransactionActionType = "upsertmerge" UpsertReplace TableTransactionActionType = "upsertreplace" )
type TableTransactionError ¶
type TableTransactionError struct { OdataError OdataError `json:"odata.error"` FailedEntityIndex int }
func (*TableTransactionError) Error ¶
func (e *TableTransactionError) Error() string
type TableTransactionResponse ¶
type TableTransactionResponse struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string // Date contains the information returned from the Date header response. Date *time.Time // PreferenceApplied contains the information returned from the Preference-Applied header response. PreferenceApplied *string // RawResponse contains the underlying HTTP response. RawResponse *http.Response // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string // The response for a single table. TransactionResponses *[]azcore.Response // Version contains the information returned from the x-ms-version header response. Version *string // ContentType contains the information returned from the Content-Type header response. ContentType *string }
type TableUpdateEntityOptions ¶
type TableUpdateEntityOptions struct { // Match condition for an entity to be updated. If specified and a matching entity is not found, an error will be raised. To force an unconditional update, // set to the wildcard character (*). If not specified, an insert will be performed when no existing entity is found to update and a replace will be performed // if an existing entity is found. IfMatch *string // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. RequestID *string // The properties for the table entity. TableEntityProperties map[string]interface{} // The timeout parameter is expressed in seconds. Timeout *int32 }
TableUpdateEntityOptions contains the optional parameters for the Table.UpdateEntity method.
type TableUpdateEntityResponse ¶
type TableUpdateEntityResponse struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string // Date contains the information returned from the Date header response. Date *time.Time // ETag contains the information returned from the ETag header response. ETag *string // RawResponse contains the underlying HTTP response. RawResponse *http.Response // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string // Version contains the information returned from the x-ms-version header response. Version *string }
TableUpdateEntityResponse contains the response from method Table.UpdateEntity.
type TableUpdateMode ¶
type TableUpdateMode string
const ( Replace TableUpdateMode = "replace" Merge TableUpdateMode = "merge" )
Source Files ¶
- cosmos_patch_transform_policy.go
- errors.go
- shared_policy_shared_key_credential.go
- table_client.go
- table_pagers.go
- table_service_client.go
- table_transactional_batch.go
- zc_client_options.go
- zc_table_constants.go
- zt_table_recorded_tests.go
- zz_generated_connection.go
- zz_generated_constants.go
- zz_generated_models.go
- zz_generated_response_types.go
- zz_generated_service_client.go
- zz_generated_table_client.go
- zz_generated_time_rfc1123.go
- zz_generated_time_rfc3339.go