Documentation
¶
Index ¶
- Variables
- func NewQueue(name string) *queue
- func NewSecret(name string) *secret
- func Run() error
- type Api
- type ApiDetails
- type ApiOption
- type Bucket
- type BucketPermission
- type Collection
- type CollectionPermission
- type Details
- type JwtSecurityRule
- type Manager
- type MethodOption
- type Queue
- type QueuePermission
- type Route
- type Schedule
- type Secret
- type SecretPermission
- type Starter
- type SubscribableTopic
- type Topic
- type TopicPermission
- type Websocket
Constants ¶
This section is empty.
Variables ¶
var BucketEverything []BucketPermission = []BucketPermission{BucketReading, BucketWriting, BucketDeleting}
var CollectionEverything []CollectionPermission = []CollectionPermission{CollectionReading, CollectionWriting, CollectionDeleting}
var QueueEverything []QueuePermission = []QueuePermission{QueueSending, QueueReceiving}
var SecretEverything []SecretPermission = []SecretPermission{SecretAccessing, SecretPutting}
Functions ¶
Types ¶
type Api ¶
type Api interface { Get(path string, handler faas.HttpMiddleware, opts ...MethodOption) Put(path string, handler faas.HttpMiddleware, opts ...MethodOption) Patch(path string, handler faas.HttpMiddleware, opts ...MethodOption) Post(path string, handler faas.HttpMiddleware, opts ...MethodOption) Delete(path string, handler faas.HttpMiddleware, opts ...MethodOption) Options(path string, handler faas.HttpMiddleware, opts ...MethodOption) NewRoute(path string, middleware ...faas.HttpMiddleware) Route Details(ctx context.Context) (*ApiDetails, error) }
Api Resource represents an HTTP API, capable of routing and securing incoming HTTP requests to handlers. path is the route path matcher e.g. '/home'. Supports path params via colon prefix e.g. '/customers/:customerId' handler the handler to register for callbacks.
Note: to chain middleware use faas.ComposeHttpMiddlware()
type ApiDetails ¶
type ApiOption ¶
type ApiOption = func(api *api)
func WithMiddleware ¶
func WithMiddleware(middleware ...faas.HttpMiddleware) ApiOption
func WithSecurity ¶
func WithSecurityJwtRule ¶
func WithSecurityJwtRule(name string, rule JwtSecurityRule) ApiOption
type Bucket ¶
type Bucket interface { With(permissions ...BucketPermission) (storage.Bucket, error) On(faas.NotificationType, string, ...faas.BucketNotificationMiddleware) }
type BucketPermission ¶
type BucketPermission string
const ( BucketReading BucketPermission = "reading" BucketWriting BucketPermission = "writing" BucketDeleting BucketPermission = "deleting" )
type Collection ¶
type Collection interface {
With(permissions ...CollectionPermission) (documents.CollectionRef, error)
}
func NewCollection ¶
func NewCollection(name string) Collection
NewCollection register this collection as a required resource for the calling function/container.
type CollectionPermission ¶
type CollectionPermission string
const ( CollectionReading CollectionPermission = "reading" CollectionWriting CollectionPermission = "writing" CollectionDeleting CollectionPermission = "deleting" )
type JwtSecurityRule ¶
type Manager ¶
type Manager interface { Run() error // contains filtered or unexported methods }
Manager is the top level object that resources are created on.
type MethodOption ¶
type MethodOption = func(mo *methodOptions)
func WithMethodSecurity ¶
func WithMethodSecurity(name string, scopes []string) MethodOption
func WithNoMethodSecurity ¶
func WithNoMethodSecurity() MethodOption
type QueuePermission ¶
type QueuePermission string
const ( QueueSending QueuePermission = "sending" QueueReceiving QueuePermission = "receiving" )
type Route ¶
type Route interface { All(handler faas.HttpMiddleware, opts ...MethodOption) Get(handler faas.HttpMiddleware, opts ...MethodOption) Patch(handler faas.HttpMiddleware, opts ...MethodOption) Put(handler faas.HttpMiddleware, opts ...MethodOption) Post(handler faas.HttpMiddleware, opts ...MethodOption) Delete(handler faas.HttpMiddleware, opts ...MethodOption) Options(handler faas.HttpMiddleware, opts ...MethodOption) }
Route providers convenience functions to register a handler in a single method.
type Schedule ¶
type Schedule interface { Cron(cron string, middleware ...faas.EventMiddleware) Every(rate string, middleware ...faas.EventMiddleware) error }
func NewSchedule ¶
NewSchedule provides a new schedule, which can be configured with a rate/cron and a callback to run on the schedule.
type SecretPermission ¶
type SecretPermission string
const ( SecretAccessing SecretPermission = "accessing" SecretPutting SecretPermission = "putting" )
type SubscribableTopic ¶
type SubscribableTopic interface { With(permissions ...TopicPermission) (Topic, error) // Subscribe will register and start a subscription handler that will be called for all events from this topic. Subscribe(...faas.EventMiddleware) }
func NewTopic ¶
func NewTopic(name string) SubscribableTopic
NewTopic creates a new Topic with the give permissions.
type TopicPermission ¶
type TopicPermission string
TopicPermission defines the available permissions on a topic
const ( // TopicPublishing is required to call Publish on a topic. TopicPublishing TopicPermission = "publishing" )
type Websocket ¶
type Websocket interface { Name() string On(eventType faas.WebsocketEventType, mwares ...faas.WebsocketMiddleware) Send(ctx context.Context, connectionId string, message []byte) error Close(ctx context.Context, connectionId string) error }
func NewWebsocket ¶
NewCollection register this collection as a required resource for the calling function/container.