common

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HttpHeaderDate                  = "Date"
	HttpHeaderContentType           = "Content-Type"
	HttpHeaderContentMD5            = "Content-MD5"
	HttpHeaderContentLength         = "Content-Length"
	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"

	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"
)
View Source
const HttpHeaderOdpsPrefix = "x-odps-"
View Source
const UserAgentValue = "odps-go-sdk/0.0.1 Go/1.17.2"

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)

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
}

func NewResourceBuilder

func NewResourceBuilder(projectName string) ResourceBuilder

func (*ResourceBuilder) Auth

func (rb *ResourceBuilder) Auth() string

func (*ResourceBuilder) Authorization

func (rb *ResourceBuilder) Authorization() string

func (*ResourceBuilder) AuthorizationId

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

func (*ResourceBuilder) CachedInstances

func (rb *ResourceBuilder) CachedInstances() string

func (*ResourceBuilder) Function

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

func (*ResourceBuilder) Functions

func (rb *ResourceBuilder) Functions() string

func (*ResourceBuilder) Instance

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

func (*ResourceBuilder) Instances

func (rb *ResourceBuilder) Instances() string

func (*ResourceBuilder) Project

func (rb *ResourceBuilder) Project() string

func (*ResourceBuilder) Projects

func (rb *ResourceBuilder) Projects() string

func (*ResourceBuilder) Resource

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

func (*ResourceBuilder) Resources

func (rb *ResourceBuilder) Resources() string

func (*ResourceBuilder) Role

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

func (*ResourceBuilder) Roles

func (rb *ResourceBuilder) Roles() string

func (*ResourceBuilder) SetProject

func (rb *ResourceBuilder) SetProject(name string)

func (*ResourceBuilder) Table

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

func (*ResourceBuilder) TableStream

func (rb *ResourceBuilder) TableStream(tableName string) string

func (*ResourceBuilder) TableWithSchemaName

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

func (*ResourceBuilder) Tables

func (rb *ResourceBuilder) Tables() string

func (*ResourceBuilder) Tunnel

func (rb *ResourceBuilder) Tunnel() string

func (*ResourceBuilder) User

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

func (*ResourceBuilder) Users

func (rb *ResourceBuilder) Users() string

func (*ResourceBuilder) Volume

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

func (*ResourceBuilder) VolumePartition

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

func (*ResourceBuilder) Volumes

func (rb *ResourceBuilder) Volumes() string

func (*ResourceBuilder) XFlow

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

func (*ResourceBuilder) XFlows

func (rb *ResourceBuilder) XFlows() string

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