common

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	UserAgentValue       = "odps-go-sdk/0.0.1 Go/1.17.2"
	HttpHeaderOdpsPrefix = "x-odps-"
)
View Source
const (
	HttpHeaderDate                          = "Date"
	HttpHeaderContentType                   = "Content-Type"
	HttpHeaderContentMD5                    = "Content-MD5"
	HttpHeaderContentDisposition            = "Content-Disposition"
	HttpHeaderContentLength                 = "Content-Length"
	HttpHeaderContentEncoding               = "Content-Encoding"
	HttpHeaderLastModified                  = "Last-Modified"
	HttpHeaderUserAgent                     = "User-Agent"
	HttpHeaderXOdpsUserAgent                = "x-odps-user-agent"
	HttpHeaderOdpsOwner                     = "x-odps-owner"
	HttpHeaderOdpsCreationTime              = "x-odps-creation-time"
	HttpHeaderOdpsRequestId                 = "x-odps-request-id"
	HttpHeaderLocation                      = "Location"
	HttpHeaderOdpsStartTime                 = "x-odps-start-time"
	HttpHeaderOdpsEndTime                   = "x-odps-end-time"
	HttpHeaderSqlTimezone                   = "x-odps-sql-timezone"
	HttpHeaderOdpsSupervisionToken          = "odps-x-supervision-token"
	HttpHeaderAuthorization                 = "Authorization"
	HttpHeaderAuthorizationSTSToken         = "authorization-sts-token"
	HttpHeaderAppAuthentication             = "application-authentication"
	HttpHeaderSTSAuthentication             = "sts-authentication"
	HttpHeaderSTSToken                      = "sts-token"
	HttpHeaderODPSBearerToken               = "x-odps-bearer-token"
	HttpHeaderOdpsDateTransFrom             = "odps-tunnel-date-transform"
	HttpHeaderOdpsTunnelVersion             = "x-odps-tunnel-version"
	HttpHeaderOdpsSlotNum                   = "odps-tunnel-slot-num"
	HttpHeaderRoutedServer                  = "odps-tunnel-routed-server"
	HttpHeaderTransferEncoding              = "Transfer-Encoding"
	HttpHeaderAcceptEncoding                = "Accept-Encoding"
	HttpHeaderOdpsSdkSupportSchemaEvolution = "odps-tunnel-sdk-support-schema-evolution"
	HttpHeaderOdpsTunnelLatestSchemaVersion = "odps-tunnel-latest-schema-version"
	HttpHeaderOdpsSchemaName                = "schema-name"
	HttpHeaderOdpsResourceName              = "x-odps-resource-name"
	HttpHeaderOdpsResourceType              = "x-odps-resource-type"
	HttpHeaderOdpsResourceSize              = "x-odps-resource-size"
	HttpHeaderOdpsComment                   = "x-odps-comment"
	HttpHeaderOdpsUpdator                   = "x-odps-updator"
	HttpHeaderOdpsCopyTableSource           = "x-odps-copy-table-source"
	HttpHeaderOdpsCopyFileSource            = "x-odps-copy-file-source"
	HttpHeaderOdpsResourceIsTemp            = "x-odps-resource-istemp"
	HttpHeaderOdpsResourceMergeTotalBytes   = "x-odps-resource-merge-total-bytes"

	XMLContentType = "application/xml"
)
View Source
const (
	ProjectsPath        = "/projects"
	SchemasPath         = "/schemas"
	TablesPath          = "/tables"
	RegistrationPath    = "/registration"
	FunctionsPath       = "/functions"
	EventsPath          = "/events"
	ResourcesPath       = "/resources"
	InstancesPath       = "/instances"
	CachedInstancesPath = "/cachedinstances"
	VolumesPath         = "/volumes"
	StreamsPath         = "/streams"
	TopologiesPath      = "/topologies"
	XFlowsPath          = "/xflows"
	StreamJobsPath      = "/streamjobs"
	ServersPath         = "/servers"
	MatricesPath        = "/matrices"
	OfflineModelsPath   = "/offlinemodels"
	UsersPath           = "/users"
	RolesPath           = "/roles"
	SessionsPath        = "/session"
	AuthPath            = "/auth"
	AuthorizationPath   = "/authorization"
	TunnelPath          = "/tunnel"
)

Variables

View Source
var GMT, _ = time.LoadLocation("GMT")
View Source
var HttpMethod = struct {
	GetMethod    string
	PutMethod    string
	PostMethod   string
	DeleteMethod string
}{
	GetMethod:    "GET",
	PutMethod:    "PUT",
	PostMethod:   "POST",
	DeleteMethod: "DELETE",
}

Functions

func ParseRFC1123Date

func ParseRFC1123Date(s string) (time.Time, error)

func QuoteRef added in v0.3.15

func QuoteRef(ref string) string

func QuoteString added in v0.3.14

func QuoteString(str string) string

func StringToBool added in v0.4.0

func StringToBool(s string) bool

StringToBool 将字符串转换为布尔值,不合法时返回 false

Types

type GMTTime

type GMTTime time.Time

func (GMTTime) Format

func (t GMTTime) Format(f string) string

func (*GMTTime) MarshalJSON

func (t *GMTTime) MarshalJSON() ([]byte, error)

func (GMTTime) String

func (t GMTTime) String() string

func (*GMTTime) UnmarshalJSON

func (t *GMTTime) UnmarshalJSON(b []byte) error

func (*GMTTime) UnmarshalXML

func (t *GMTTime) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Properties

type Properties []Property

Properties just alias to []Property

func (Properties) Get

func (ps Properties) Get(key string) string

type Property

type Property struct {
	Name  string
	Value string
}

type ResourceBuilder

type ResourceBuilder struct {
	ProjectName string
}

ResourceBuilder is a helper to build resource path

func NewResourceBuilder

func NewResourceBuilder(projectName string) ResourceBuilder

NewResourceBuilder creates a new ResourceBuilder

func (*ResourceBuilder) Auth

func (rb *ResourceBuilder) Auth() string

Auth returns the auth resource path

func (*ResourceBuilder) Authorization

func (rb *ResourceBuilder) Authorization() string

Authorization returns the authorization resource path

func (*ResourceBuilder) AuthorizationId

func (rb *ResourceBuilder) AuthorizationId(instanceId string) string

AuthorizationId returns the authorization resource path with instance id

func (*ResourceBuilder) CachedInstances

func (rb *ResourceBuilder) CachedInstances() string

CachedInstances returns the cached instances resource path

func (*ResourceBuilder) Function

func (rb *ResourceBuilder) Function(functionName string) string

Function returns the function resource path

func (*ResourceBuilder) Functions

func (rb *ResourceBuilder) Functions() string

Functions returns the functions resource path

func (*ResourceBuilder) Instance

func (rb *ResourceBuilder) Instance(instanceId string) string

Instance returns the instance resource path

func (*ResourceBuilder) Instances

func (rb *ResourceBuilder) Instances() string

Instances returns the instances resource path

func (*ResourceBuilder) Project

func (rb *ResourceBuilder) Project() string

Project returns the project resource path

func (*ResourceBuilder) Projects

func (rb *ResourceBuilder) Projects() string

Projects returns the projects resource path

func (*ResourceBuilder) Resource

func (rb *ResourceBuilder) Resource(resourceName string) string

Resource returns the resource resource path

func (*ResourceBuilder) Resources

func (rb *ResourceBuilder) Resources() string

Resources returns the resources resource path

func (*ResourceBuilder) Role

func (rb *ResourceBuilder) Role(roleName string) string

Role returns the role resource path

func (*ResourceBuilder) Roles

func (rb *ResourceBuilder) Roles() string

Roles returns the roles resource path

func (*ResourceBuilder) Schema added in v0.3.8

func (rb *ResourceBuilder) Schema(schemaName string) string

Schema returns the schema resource path

func (*ResourceBuilder) Schemas added in v0.3.8

func (rb *ResourceBuilder) Schemas() string

Schemas returns the schemas resource path

func (*ResourceBuilder) SetProject

func (rb *ResourceBuilder) SetProject(name string)

SetProject sets the project name

func (*ResourceBuilder) Table

func (rb *ResourceBuilder) Table(schemaName, tableName string) string

Table returns the table resource path

func (*ResourceBuilder) Tables

func (rb *ResourceBuilder) Tables() string

Tables returns the tables resource path

func (*ResourceBuilder) Tunnel

func (rb *ResourceBuilder) Tunnel() string

Tunnel returns the tunnel resource path

func (*ResourceBuilder) User

func (rb *ResourceBuilder) User(userId string) string

User returns the user resource path

func (*ResourceBuilder) Users

func (rb *ResourceBuilder) Users() string

Users returns the users resource path

func (*ResourceBuilder) Volume

func (rb *ResourceBuilder) Volume(volumeName string) string

Volume returns the volume resource path

func (*ResourceBuilder) VolumePartition

func (rb *ResourceBuilder) VolumePartition(volumeName, partitionKey string) string

VolumePartition returns the volume partition resource path

func (*ResourceBuilder) Volumes

func (rb *ResourceBuilder) Volumes() string

Volumes returns the volumes resource path

func (*ResourceBuilder) XFlow

func (rb *ResourceBuilder) XFlow(xFlowName string) string

XFlow returns the xflow resource path

func (*ResourceBuilder) XFlows

func (rb *ResourceBuilder) XFlows() string

XFlows returns the xflows resource path

type Result

type Result struct {
	Data  interface{}
	Error error
}

func (*Result) IsErr

func (r *Result) IsErr() bool

func (*Result) IsOk

func (r *Result) IsOk() bool

Jump to

Keyboard shortcuts

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