nuclio

package module
v0.0.0-...-502c87b Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: Apache-2.0 Imports: 3 Imported by: 50

README

Nuclio SDK

To get started with nuclio, see https://github.com/nuclio/nuclio.

Documentation

Overview

Copyright 2017 The Nuclio Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2017 The Nuclio Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2017 The Nuclio Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2017 The Nuclio Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2017 The Nuclio Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2017 The Nuclio Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2017 The Nuclio Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2017 The Nuclio Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2017 The Nuclio Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2017 The Nuclio Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var ErrAccepted = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrAlreadyReported = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrBadGateway = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrBadRequest = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrConflict = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrCreated = ErrorWithStatusCode{/* contains filtered or unexported fields */}

wrapped errors

View Source
var ErrExpectationFailed = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrFailedDependency = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrForbidden = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrFound = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrGatewayTimeout = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrGone = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrHTTPVersionNotSupported = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrIMUsed = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrInsufficientStorage = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrInternalServerError = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrLengthRequired = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrLocked = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrLoopDetected = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrMethodNotAllowed = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrMovedPermanently = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrMultiStatus = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrMultipleChoices = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrNetworkAuthenticationRequired = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrNoContent = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrNonAuthoritativeInfo = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrNotAcceptable = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrNotExtended = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrNotFound = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrNotImplemented = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrNotModified = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrPartialContent = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrPaymentRequired = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrPermanentRedirect = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrPreconditionFailed = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrPreconditionRequired = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrProxyAuthRequired = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrRequestEntityTooLarge = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrRequestHeaderFieldsTooLarge = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrRequestTimeout = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrRequestURITooLong = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrRequestedRangeNotSatisfiable = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrResetContent = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrSeeOther = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrServiceUnavailable = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrTeapot = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrTemporaryRedirect = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrTooManyRequests = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrUnauthorized = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrUnavailableForLegalReasons = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrUnprocessableEntity = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrUnsupported = errors.New("Event does not support this interface")
View Source
var ErrUnsupportedMediaType = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrUpgradeRequired = ErrorWithStatusCode{/* contains filtered or unexported fields */}
View Source
var ErrUseProxy = ErrorWithStatusCode{/* contains filtered or unexported fields */}

Functions

This section is empty.

Types

type AbstractEvent

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

func (*AbstractEvent) GetBody

func (ae *AbstractEvent) GetBody() []byte

func (*AbstractEvent) GetContentType

func (ae *AbstractEvent) GetContentType() string

func (*AbstractEvent) GetField

func (ae *AbstractEvent) GetField(key string) interface{}

func (*AbstractEvent) GetFieldByteSlice

func (ae *AbstractEvent) GetFieldByteSlice(key string) []byte

func (*AbstractEvent) GetFieldInt

func (ae *AbstractEvent) GetFieldInt(key string) (int, error)

func (*AbstractEvent) GetFieldString

func (ae *AbstractEvent) GetFieldString(key string) string

func (*AbstractEvent) GetFields

func (ae *AbstractEvent) GetFields() map[string]interface{}

func (*AbstractEvent) GetHeader

func (ae *AbstractEvent) GetHeader(key string) interface{}

func (*AbstractEvent) GetHeaderByteSlice

func (ae *AbstractEvent) GetHeaderByteSlice(key string) []byte

func (*AbstractEvent) GetHeaderString

func (ae *AbstractEvent) GetHeaderString(key string) string

func (*AbstractEvent) GetHeaders

func (ae *AbstractEvent) GetHeaders() map[string]interface{}

func (*AbstractEvent) GetID

func (ae *AbstractEvent) GetID() ID

func (*AbstractEvent) GetMethod

func (ae *AbstractEvent) GetMethod() string

func (*AbstractEvent) GetPath

func (ae *AbstractEvent) GetPath() string

func (*AbstractEvent) GetSize

func (ae *AbstractEvent) GetSize() int

func (*AbstractEvent) GetSource

func (ae *AbstractEvent) GetSource() SourceInfoProvider

func (*AbstractEvent) GetTimestamp

func (ae *AbstractEvent) GetTimestamp() time.Time

func (*AbstractEvent) GetURL

func (ae *AbstractEvent) GetURL() string

func (*AbstractEvent) GetVersion

func (ae *AbstractEvent) GetVersion() int

func (*AbstractEvent) SetID

func (ae *AbstractEvent) SetID(id ID)

func (*AbstractEvent) SetSourceProvider

func (ae *AbstractEvent) SetSourceProvider(sourceInfoProvider SourceInfoProvider)

type AbstractSync

type AbstractSync struct {
	AbstractEvent
}

func (*AbstractSync) GetHostAddress

func (as *AbstractSync) GetHostAddress() string

func (*AbstractSync) GetQuery

func (as *AbstractSync) GetQuery() map[string]interface{}

func (*AbstractSync) GetRemoteAddress

func (as *AbstractSync) GetRemoteAddress() string

func (*AbstractSync) GetWorkflowStep

func (as *AbstractSync) GetWorkflowStep() string

type Async

type Async interface {
	Event
	GetType() string
	GetApplicationID() string
	GetRetryCount() int
	GetReplyTo() string
	GetWorkflow() string
	GetWorkflowStep() string
	GetWorkflowIndex() string
}

type Context

type Context struct {
	Logger      Logger
	DataBinding map[string]DataBinding
}

type DataBinding

type DataBinding interface {
}

type ErrorWithStatusCode

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

func (*ErrorWithStatusCode) StatusCode

func (ewsc *ErrorWithStatusCode) StatusCode() int

type Event

type Event interface {
	GetVersion() int
	GetID() ID
	SetID(id ID)
	SetSourceProvider(sourceInfoProvider SourceInfoProvider)
	GetSource() SourceInfoProvider
	GetContentType() string
	GetBody() []byte
	GetSize() int
	GetHeader(key string) interface{}
	GetHeaderByteSlice(key string) []byte
	GetHeaderString(key string) string
	GetHeaders() map[string]interface{}
	GetField(key string) interface{}
	GetFieldByteSlice(key string) []byte
	GetFieldString(key string) string
	GetFieldInt(key string) (int, error)
	GetFields() map[string]interface{}
	GetTimestamp() time.Time
	GetPath() string
	GetURL() string
	GetMethod() string
}

type ID

type ID struct {
	*uuid.UUID
}

ID is event ID

func NewID

func NewID() ID

NewID creates new random event ID

func (ID) String

func (id ID) String() string

type Logger

type Logger interface {

	// emit a log entry of a given verbosity. the first argument may be an object, a string
	// or a format string. in case of the latter, the following varargs are passed
	// to a formatter (e.g. fmt.Sprintf)
	Error(format interface{}, vars ...interface{})
	Warn(format interface{}, vars ...interface{})
	Info(format interface{}, vars ...interface{})
	Debug(format interface{}, vars ...interface{})

	// emit a structured log entry. example:
	//
	// l.InfoWith("The message",
	// 	"first-key", "first-value",
	// 	"second-key", 2)
	//
	ErrorWith(format interface{}, vars ...interface{})
	WarnWith(format interface{}, vars ...interface{})
	InfoWith(format interface{}, vars ...interface{})
	DebugWith(format interface{}, vars ...interface{})

	// flushes buffered logs, if applicable
	Flush()

	// returns a child logger, if underlying logger supports hierarchal logging
	GetChild(name string) Logger
}

type Response

type Response struct {
	StatusCode  int
	ContentType string
	Headers     map[string]interface{}
	Body        []byte
}

type SourceInfoProvider

type SourceInfoProvider interface {

	// get the class of source (sync, async, etc)
	GetClass() string

	// get specific kind of source (http, rabbit mq, etc)
	GetKind() string
}

type Sync

type Sync interface {
	Event
	GetHostAddress() string
	GetRemoteAddress() string
	GetWorkflowStep() string
	GetQuery() map[string]interface{}
}

type WithStatusCode

type WithStatusCode interface {
	StatusCode() int
}

Jump to

Keyboard shortcuts

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