azfunc

package
v0.0.2-0...-1b30d8d Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2019 License: MIT Imports: 5 Imported by: 6

Documentation

Index

Constants

View Source
const (
	// HTTPTriggerType represents a HTTP trigger in function load request from the host
	HTTPTriggerType = "httpTrigger"

	// BlobTriggerType represents a blob trigger in function load request from host
	BlobTriggerType = "blobTrigger"

	// HTTPBindingType represents a HTTP binding in function load request from the host
	HTTPBindingType = "http"

	// BlobBindingType represents a blob binding in function load request from the host
	BlobBindingType = "blob"
)

TODO - add other binding and trigger types TODO - in the end, every trigger is a binding - does it make sense to have separate types for trigger / binding?

Variables

View Source
var StringToType = map[string]reflect.Type{
	"*http.Request":   reflect.TypeOf((*http.Request)(nil)),
	"*azfunc.Context": reflect.TypeOf((*Context)(nil)),
	"*azfunc.Blob":    reflect.TypeOf((*Blob)(nil)),
}

StringToType - Because we don't have go/types information, we need to map the type info from the AST (which is string) to the actual types - see loader.go:83 investiage automatically adding here all types from package azfunc

Functions

This section is empty.

Types

type Arg

type Arg struct {
	Name string
	Type reflect.Type
}

Arg represents an initial representation of a func argument

type Blob

type Blob struct {
	Data string
}

Blob contains the data from a blob as string

type BlobProperties

type BlobProperties struct {
	LastModified       time.Time `xml:"Last-Modified" json:"LastModified"`
	Etag               string    `xml:"Etag" json:"ETag"`
	ContentMD5         string    `xml:"Content-MD5" header:"x-ms-blob-content-md5" json:"ContentMD5"`
	ContentLength      int64     `xml:"Content-Length" json:"Length"`
	ContentType        string    `xml:"Content-Type" header:"x-ms-blob-content-type" json:"ContentType"`
	ContentEncoding    string    `xml:"Content-Encoding" header:"x-ms-blob-content-encoding" json:"ContentEncoding"`
	CacheControl       string    `xml:"Cache-Control" header:"x-ms-blob-cache-control" json:"CacheControl"`
	ContentLanguage    string    `xml:"Cache-Language" header:"x-ms-blob-content-language" json:"ContentLanguage"`
	ContentDisposition string    `xml:"Content-Disposition" header:"x-ms-blob-content-disposition" json:"ContentDisposition"`
	BlobType           BlobType  `xml:"x-ms-blob-blob-type" json:"BlobType"`
	SequenceNumber     int64     `xml:"x-ms-blob-sequence-number" json:"PageBlobSequenceNumber"`
	// TODO these properties do not appear in the json or in the CloudBlob type from .NET - investigate if needed or can be removed
	CopyID                string    `xml:"CopyId"`
	CopyStatus            string    `xml:"CopyStatus"`
	CopySource            string    `xml:"CopySource"`
	CopyProgress          string    `xml:"CopyProgress"`
	CopyCompletionTime    time.Time `xml:"CopyCompletionTime"`
	CopyStatusDescription string    `xml:"CopyStatusDescription"`
	//
	LeaseStatus     string `xml:"LeaseStatus" json:"LeaseStatus"`
	LeaseState      string `xml:"LeaseState" json:"LeaseState"`
	LeaseDuration   string `xml:"LeaseDuration" json:"LeaseDuration"`
	ServerEncrypted bool   `xml:"ServerEncrypted" json:"IsServerEncrypted"`
	IncrementalCopy bool   `xml:"IncrementalCopy" json:"IsIncrementalCopy"`
}

BlobProperties contains various properties of a blob returned in various endpoints like ListBlobs or GetBlobProperties.

type BlobType

type BlobType string

BlobType defines the type of the Azure Blob.

const (
	BlobTypeBlock  BlobType = "BlockBlob"
	BlobTypePage   BlobType = "PageBlob"
	BlobTypeAppend BlobType = "AppendBlob"
)

Types of page blobs

type Context

type Context struct {
	FunctionID   string
	InvocationID string
	Logger       *logger.Logger
}

Context contains the runtime context of the function

type Func

type Func struct {
	Func             reflect.Value
	Bindings         map[string]*rpc.BindingInfo
	In               []reflect.Type
	NamedInArgs      []*Arg
	Out              []reflect.Type
	NamedOutBindings map[string]reflect.Value
}

Func contains a function symbol with in and out param types

type Sys

type Sys struct {
	MethodName string    `json:"MethodName"`
	UtcNow     time.Time `json:"UtcNow"`
	RandGUID   string    `json:"RandGuid"`
}

Sys - to clarify the name / use of this type

Jump to

Keyboard shortcuts

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