armresourcegraph

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: MIT Imports: 12 Imported by: 25

README

Azure Resource Graph Module for Go

PkgGoDev

The armresourcegraph module provides operations for working with Azure Resource Graph.

Source code

Getting started

Prerequisites

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Resource Graph module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcegraph/armresourcegraph

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Resource Graph. The azidentity module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.

cred, err := azidentity.NewDefaultAzureCredential(nil)

For more information on authentication, please see the documentation for azidentity at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity.

Clients

Azure Resource Graph modules consist of one or more clients. A client groups a set of related APIs, providing access to its functionality within the specified subscription. Create one or more clients to access the APIs you require using your credential.

client := armresourcegraph.(<subscription ID>, cred, nil)

You can use ClientOptions in package github.com/Azure/azure-sdk-for-go/sdk/azcore/arm to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for azcore at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore.

options = arm.ClientOptions{
    Host: arm.AzureChina,
}
client := armresourcegraph.(<subscription ID>, cred, &options)

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Resource Graph label.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizationScopeFilter

type AuthorizationScopeFilter string

AuthorizationScopeFilter - Defines what level of authorization resources should be returned based on the which subscriptions and management groups are passed as scopes.

const (
	AuthorizationScopeFilterAtScopeAndBelow      AuthorizationScopeFilter = "AtScopeAndBelow"
	AuthorizationScopeFilterAtScopeAndAbove      AuthorizationScopeFilter = "AtScopeAndAbove"
	AuthorizationScopeFilterAtScopeExact         AuthorizationScopeFilter = "AtScopeExact"
	AuthorizationScopeFilterAtScopeAboveAndBelow AuthorizationScopeFilter = "AtScopeAboveAndBelow"
)

func PossibleAuthorizationScopeFilterValues

func PossibleAuthorizationScopeFilterValues() []AuthorizationScopeFilter

PossibleAuthorizationScopeFilterValues returns the possible values for the AuthorizationScopeFilter const type.

func (AuthorizationScopeFilter) ToPtr

ToPtr returns a *AuthorizationScopeFilter pointing to the current value.

type Client added in v0.2.0

type Client struct {
	// contains filtered or unexported fields
}

Client contains the methods for the ResourceGraphClient group. Don't use this type directly, use NewClient() instead.

func NewClient added in v0.2.0

func NewClient(credential azcore.TokenCredential, options *arm.ClientOptions) *Client

NewClient creates a new instance of Client with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*Client) Resources added in v0.2.0

func (client *Client) Resources(ctx context.Context, query QueryRequest, options *ClientResourcesOptions) (ClientResourcesResponse, error)

Resources - Queries the resources managed by Azure Resource Manager for scopes specified in the request. If the operation fails it returns an *azcore.ResponseError type. query - Request specifying query and its options. options - ClientResourcesOptions contains the optional parameters for the Client.Resources method.

Example

x-ms-original-file: specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2021-06-01-preview/examples/ResourcesPropertiesQuery.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcegraph/armresourcegraph"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armresourcegraph.NewClient(cred, nil)
	res, err := client.Resources(ctx,
		armresourcegraph.QueryRequest{
			Query: to.StringPtr("<query>"),
			Subscriptions: []*string{
				to.StringPtr("cfbbd179-59d2-4052-aa06-9270a38aa9d6")},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ClientResourcesResult)
}
Output:

func (*Client) ResourcesHistory added in v0.2.0

ResourcesHistory - List all snapshots of a resource for a given time interval. If the operation fails it returns an *azcore.ResponseError type. request - Request specifying the query and its options. options - ClientResourcesHistoryOptions contains the optional parameters for the Client.ResourcesHistory method.

Example

x-ms-original-file: specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2021-06-01-preview/examples/ResourcesHistoryMgsGet.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcegraph/armresourcegraph"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armresourcegraph.NewClient(cred, nil)
	res, err := client.ResourcesHistory(ctx,
		armresourcegraph.ResourcesHistoryRequest{
			ManagementGroups: []*string{
				to.StringPtr("e927f598-c1d4-4f72-8541-95d83a6a4ac8"),
				to.StringPtr("ProductionMG")},
			Options: &armresourcegraph.ResourcesHistoryRequestOptions{
				Interval: &armresourcegraph.DateTimeInterval{
					End:   to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-12T01:25:00.0000000Z"); return t }()),
					Start: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-12T01:00:00.0000000Z"); return t }()),
				},
			},
			Query: to.StringPtr("<query>"),
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ClientResourcesHistoryResult)
}
Output:

type ClientResourcesHistoryOptions added in v0.2.0

type ClientResourcesHistoryOptions struct {
}

ClientResourcesHistoryOptions contains the optional parameters for the Client.ResourcesHistory method.

type ClientResourcesHistoryResponse added in v0.2.0

type ClientResourcesHistoryResponse struct {
	ClientResourcesHistoryResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ClientResourcesHistoryResponse contains the response from method Client.ResourcesHistory.

type ClientResourcesHistoryResult added in v0.2.0

type ClientResourcesHistoryResult struct {
	// Any object
	Object map[string]interface{}
}

ClientResourcesHistoryResult contains the result from method Client.ResourcesHistory.

type ClientResourcesOptions added in v0.2.0

type ClientResourcesOptions struct {
}

ClientResourcesOptions contains the optional parameters for the Client.Resources method.

type ClientResourcesResponse added in v0.2.0

type ClientResourcesResponse struct {
	ClientResourcesResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ClientResourcesResponse contains the response from method Client.Resources.

type ClientResourcesResult added in v0.2.0

type ClientResourcesResult struct {
	QueryResponse
}

ClientResourcesResult contains the result from method Client.Resources.

type Column

type Column struct {
	// REQUIRED; Column name.
	Name *string `json:"name,omitempty"`

	// REQUIRED; Column data type.
	Type *ColumnDataType `json:"type,omitempty"`
}

Column - Query result column descriptor.

type ColumnDataType

type ColumnDataType string

ColumnDataType - Data type of a column in a table.

const (
	ColumnDataTypeString   ColumnDataType = "string"
	ColumnDataTypeInteger  ColumnDataType = "integer"
	ColumnDataTypeNumber   ColumnDataType = "number"
	ColumnDataTypeBoolean  ColumnDataType = "boolean"
	ColumnDataTypeObject   ColumnDataType = "object"
	ColumnDataTypeDatetime ColumnDataType = "datetime"
)

func PossibleColumnDataTypeValues

func PossibleColumnDataTypeValues() []ColumnDataType

PossibleColumnDataTypeValues returns the possible values for the ColumnDataType const type.

func (ColumnDataType) ToPtr

func (c ColumnDataType) ToPtr() *ColumnDataType

ToPtr returns a *ColumnDataType pointing to the current value.

type DateTimeInterval

type DateTimeInterval struct {
	// REQUIRED; A datetime indicating the exclusive/open end of the time interval, i.e. [start,end). Specifying an end that occurs
	// chronologically before start will result in an error.
	End *time.Time `json:"end,omitempty"`

	// REQUIRED; A datetime indicating the inclusive/closed start of the time interval, i.e. [start, end). Specifying a start
	// that occurs chronologically after end will result in an error.
	Start *time.Time `json:"start,omitempty"`
}

DateTimeInterval - An interval in time specifying the date and time for the inclusive start and exclusive end, i.e. [start, end).

func (DateTimeInterval) MarshalJSON

func (d DateTimeInterval) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DateTimeInterval.

func (*DateTimeInterval) UnmarshalJSON

func (d *DateTimeInterval) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DateTimeInterval.

type Error

type Error struct {
	// REQUIRED; Error code identifying the specific error.
	Code *string `json:"code,omitempty"`

	// REQUIRED; A human readable error message.
	Message *string `json:"message,omitempty"`

	// Error details
	Details []*ErrorDetails `json:"details,omitempty"`
}

Error details.

func (Error) MarshalJSON

func (e Error) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Error.

type ErrorDetails

type ErrorDetails struct {
	// REQUIRED; Error code identifying the specific error.
	Code *string `json:"code,omitempty"`

	// REQUIRED; A human readable error message.
	Message *string `json:"message,omitempty"`

	// OPTIONAL; Contains additional key/value pairs not defined in the schema.
	AdditionalProperties map[string]map[string]interface{}
}

ErrorDetails - Error details.

func (ErrorDetails) MarshalJSON

func (e ErrorDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ErrorDetails.

func (*ErrorDetails) UnmarshalJSON

func (e *ErrorDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetails.

type ErrorResponse

type ErrorResponse struct {
	// REQUIRED; Error information.
	Error *Error `json:"error,omitempty"`
}

ErrorResponse - An error response from the API.

type Facet

type Facet struct {
	// REQUIRED; Facet expression, same as in the corresponding facet request.
	Expression *string `json:"expression,omitempty"`

	// REQUIRED; Result type
	ResultType *string `json:"resultType,omitempty"`
}

Facet - A facet containing additional statistics on the response of a query. Can be either FacetResult or FacetError.

func (*Facet) GetFacet

func (f *Facet) GetFacet() *Facet

GetFacet implements the FacetClassification interface for type Facet.

type FacetClassification

type FacetClassification interface {
	// GetFacet returns the Facet content of the underlying type.
	GetFacet() *Facet
}

FacetClassification provides polymorphic access to related types. Call the interface's GetFacet() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *Facet, *FacetError, *FacetResult

type FacetError

type FacetError struct {
	// REQUIRED; An array containing detected facet errors with details.
	Errors []*ErrorDetails `json:"errors,omitempty"`

	// REQUIRED; Facet expression, same as in the corresponding facet request.
	Expression *string `json:"expression,omitempty"`

	// REQUIRED; Result type
	ResultType *string `json:"resultType,omitempty"`
}

FacetError - A facet whose execution resulted in an error.

func (*FacetError) GetFacet added in v0.2.0

func (f *FacetError) GetFacet() *Facet

GetFacet implements the FacetClassification interface for type FacetError.

func (FacetError) MarshalJSON

func (f FacetError) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type FacetError.

func (*FacetError) UnmarshalJSON

func (f *FacetError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type FacetError.

type FacetRequest

type FacetRequest struct {
	// REQUIRED; The column or list of columns to summarize by
	Expression *string `json:"expression,omitempty"`

	// The options for facet evaluation
	Options *FacetRequestOptions `json:"options,omitempty"`
}

FacetRequest - A request to compute additional statistics (facets) over the query results.

type FacetRequestOptions

type FacetRequestOptions struct {
	// Specifies the filter condition for the 'where' clause which will be run on main query's result, just before the actual
	// faceting.
	Filter *string `json:"filter,omitempty"`

	// The column name or query expression to sort on. Defaults to count if not present.
	SortBy *string `json:"sortBy,omitempty"`

	// The sorting order by the selected column (count by default).
	SortOrder *FacetSortOrder `json:"sortOrder,omitempty"`

	// The maximum number of facet rows that should be returned.
	Top *int32 `json:"$top,omitempty"`
}

FacetRequestOptions - The options for facet evaluation

type FacetResult

type FacetResult struct {
	// REQUIRED; Number of records returned in the facet response.
	Count *int32 `json:"count,omitempty"`

	// REQUIRED; A JObject array or Table containing the desired facets. Only present if the facet is valid.
	Data map[string]interface{} `json:"data,omitempty"`

	// REQUIRED; Facet expression, same as in the corresponding facet request.
	Expression *string `json:"expression,omitempty"`

	// REQUIRED; Result type
	ResultType *string `json:"resultType,omitempty"`

	// REQUIRED; Number of total records in the facet results.
	TotalRecords *int64 `json:"totalRecords,omitempty"`
}

FacetResult - Successfully executed facet containing additional statistics on the response of a query.

func (*FacetResult) GetFacet added in v0.2.0

func (f *FacetResult) GetFacet() *Facet

GetFacet implements the FacetClassification interface for type FacetResult.

func (FacetResult) MarshalJSON

func (f FacetResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type FacetResult.

func (*FacetResult) UnmarshalJSON

func (f *FacetResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type FacetResult.

type FacetSortOrder

type FacetSortOrder string

FacetSortOrder - The sorting order by the selected column (count by default).

const (
	FacetSortOrderAsc  FacetSortOrder = "asc"
	FacetSortOrderDesc FacetSortOrder = "desc"
)

func PossibleFacetSortOrderValues

func PossibleFacetSortOrderValues() []FacetSortOrder

PossibleFacetSortOrderValues returns the possible values for the FacetSortOrder const type.

func (FacetSortOrder) ToPtr

func (c FacetSortOrder) ToPtr() *FacetSortOrder

ToPtr returns a *FacetSortOrder pointing to the current value.

type Operation

type Operation struct {
	// Display metadata associated with the operation.
	Display *OperationDisplay `json:"display,omitempty"`

	// Operation name: {provider}/{resource}/{operation}
	Name *string `json:"name,omitempty"`

	// The origin of operations.
	Origin *string `json:"origin,omitempty"`
}

Operation - Resource Graph REST API operation definition.

type OperationDisplay

type OperationDisplay struct {
	// Description for the operation.
	Description *string `json:"description,omitempty"`

	// Type of operation: get, read, delete, etc.
	Operation *string `json:"operation,omitempty"`

	// Service provider: Microsoft Resource Graph.
	Provider *string `json:"provider,omitempty"`

	// Resource on which the operation is performed etc.
	Resource *string `json:"resource,omitempty"`
}

OperationDisplay - Display metadata associated with the operation.

type OperationListResult

type OperationListResult struct {
	// List of Resource Graph operations supported by the Resource Graph resource provider.
	Value []*Operation `json:"value,omitempty"`
}

OperationListResult - Result of the request to list Resource Graph operations. It contains a list of operations and a URL link to get the next set of results.

func (OperationListResult) MarshalJSON

func (o OperationListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

type OperationsClient

type OperationsClient struct {
	// contains filtered or unexported fields
}

OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.

func NewOperationsClient

func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) *OperationsClient

NewOperationsClient creates a new instance of OperationsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*OperationsClient) List

List - Lists all of the available REST API operations. If the operation fails it returns an *azcore.ResponseError type. options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.

Example

x-ms-original-file: specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2021-06-01-preview/examples/OperationsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcegraph/armresourcegraph"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armresourcegraph.NewOperationsClient(cred, nil)
	res, err := client.List(ctx,
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.OperationsClientListResult)
}
Output:

type OperationsClientListOptions added in v0.2.0

type OperationsClientListOptions struct {
}

OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.

type OperationsClientListResponse added in v0.2.0

type OperationsClientListResponse struct {
	OperationsClientListResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

OperationsClientListResponse contains the response from method OperationsClient.List.

type OperationsClientListResult added in v0.2.0

type OperationsClientListResult struct {
	OperationListResult
}

OperationsClientListResult contains the result from method OperationsClient.List.

type QueryRequest

type QueryRequest struct {
	// REQUIRED; The resources query.
	Query *string `json:"query,omitempty"`

	// An array of facet requests to be computed against the query result.
	Facets []*FacetRequest `json:"facets,omitempty"`

	// Azure management groups against which to execute the query. Example: [ 'mg1', 'mg2' ]
	ManagementGroups []*string `json:"managementGroups,omitempty"`

	// The query evaluation options
	Options *QueryRequestOptions `json:"options,omitempty"`

	// Azure subscriptions against which to execute the query.
	Subscriptions []*string `json:"subscriptions,omitempty"`
}

QueryRequest - Describes a query to be executed.

func (QueryRequest) MarshalJSON

func (q QueryRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QueryRequest.

type QueryRequestOptions

type QueryRequestOptions struct {
	// Only applicable for tenant and management group level queries to decide whether to allow partial scopes for result in case
	// the number of subscriptions exceed allowed limits.
	AllowPartialScopes *bool `json:"allowPartialScopes,omitempty"`

	// Defines what level of authorization resources should be returned based on the which subscriptions and management groups
	// are passed as scopes.
	AuthorizationScopeFilter *AuthorizationScopeFilter `json:"authorizationScopeFilter,omitempty"`

	// Defines in which format query result returned.
	ResultFormat *ResultFormat `json:"resultFormat,omitempty"`

	// The number of rows to skip from the beginning of the results. Overrides the next page offset when $skipToken property is
	// present.
	Skip *int32 `json:"$skip,omitempty"`

	// Continuation token for pagination, capturing the next page size and offset, as well as the context of the query.
	SkipToken *string `json:"$skipToken,omitempty"`

	// The maximum number of rows that the query should return. Overrides the page size when $skipToken property is present.
	Top *int32 `json:"$top,omitempty"`
}

QueryRequestOptions - The options for query evaluation

type QueryResponse

type QueryResponse struct {
	// REQUIRED; Number of records returned in the current response. In the case of paging, this is the number of records in the
	// current page.
	Count *int64 `json:"count,omitempty"`

	// REQUIRED; Query output in JObject array or Table format.
	Data map[string]interface{} `json:"data,omitempty"`

	// REQUIRED; Indicates whether the query results are truncated.
	ResultTruncated *ResultTruncated `json:"resultTruncated,omitempty"`

	// REQUIRED; Number of total records matching the query.
	TotalRecords *int64 `json:"totalRecords,omitempty"`

	// Query facets.
	Facets []FacetClassification `json:"facets,omitempty"`

	// When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current
	// request) to retrieve the next page of data.
	SkipToken *string `json:"$skipToken,omitempty"`
}

QueryResponse - Query result.

func (QueryResponse) MarshalJSON

func (q QueryResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QueryResponse.

func (*QueryResponse) UnmarshalJSON

func (q *QueryResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QueryResponse.

type ResourcesHistoryRequest

type ResourcesHistoryRequest struct {
	// Azure management groups against which to execute the query. Example: [ 'mg1', 'mg2' ]
	ManagementGroups []*string `json:"managementGroups,omitempty"`

	// The history request evaluation options
	Options *ResourcesHistoryRequestOptions `json:"options,omitempty"`

	// The resources query.
	Query *string `json:"query,omitempty"`

	// Azure subscriptions against which to execute the query.
	Subscriptions []*string `json:"subscriptions,omitempty"`
}

ResourcesHistoryRequest - Describes a history request to be executed.

func (ResourcesHistoryRequest) MarshalJSON

func (r ResourcesHistoryRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ResourcesHistoryRequest.

type ResourcesHistoryRequestOptions

type ResourcesHistoryRequestOptions struct {
	// The time interval used to fetch history.
	Interval *DateTimeInterval `json:"interval,omitempty"`

	// Defines in which format query result returned.
	ResultFormat *ResultFormat `json:"resultFormat,omitempty"`

	// The number of rows to skip from the beginning of the results. Overrides the next page offset when $skipToken property is
	// present.
	Skip *int32 `json:"$skip,omitempty"`

	// Continuation token for pagination, capturing the next page size and offset, as well as the context of the query.
	SkipToken *string `json:"$skipToken,omitempty"`

	// The maximum number of rows that the query should return. Overrides the page size when $skipToken property is present.
	Top *int32 `json:"$top,omitempty"`
}

ResourcesHistoryRequestOptions - The options for history request evaluation

type ResultFormat

type ResultFormat string

ResultFormat - Defines in which format query result returned.

const (
	ResultFormatTable       ResultFormat = "table"
	ResultFormatObjectArray ResultFormat = "objectArray"
)

func PossibleResultFormatValues

func PossibleResultFormatValues() []ResultFormat

PossibleResultFormatValues returns the possible values for the ResultFormat const type.

func (ResultFormat) ToPtr

func (c ResultFormat) ToPtr() *ResultFormat

ToPtr returns a *ResultFormat pointing to the current value.

type ResultTruncated

type ResultTruncated string

ResultTruncated - Indicates whether the query results are truncated.

const (
	ResultTruncatedTrue  ResultTruncated = "true"
	ResultTruncatedFalse ResultTruncated = "false"
)

func PossibleResultTruncatedValues

func PossibleResultTruncatedValues() []ResultTruncated

PossibleResultTruncatedValues returns the possible values for the ResultTruncated const type.

func (ResultTruncated) ToPtr

func (c ResultTruncated) ToPtr() *ResultTruncated

ToPtr returns a *ResultTruncated pointing to the current value.

type Table

type Table struct {
	// REQUIRED; Query result column descriptors.
	Columns []*Column `json:"columns,omitempty"`

	// REQUIRED; Query result rows.
	Rows [][]map[string]interface{} `json:"rows,omitempty"`
}

Table - Query output in tabular format.

func (Table) MarshalJSON

func (t Table) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Table.

Jump to

Keyboard shortcuts

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