Documentation
¶
Index ¶
- Variables
- func NewKv(name string) *kvstore
- func NewQueue(name string) *queue
- func NewSecret(name string) *secret
- func Run() error
- type Api
- type ApiDetails
- type ApiOption
- type Bucket
- type BucketPermission
- type Details
- type JwtSecurityRule
- type KvStore
- type KvStorePermission
- type Manager
- type MethodOption
- type OidcOptions
- type OidcSecurityDefinition
- type Queue
- type QueuePermission
- type Route
- type Schedule
- type Secret
- type SecretPermission
- type SecurityOption
- type SubscribableTopic
- type Topic
- type TopicPermission
- type Websocket
Constants ¶
This section is empty.
Variables ¶
var BucketEverything []BucketPermission = []BucketPermission{BucketRead, BucketWrite, BucketDelete}
var KvStoreEverything []KvStorePermission = []KvStorePermission{KvStoreWrite, KvStoreRead, KvStoreDelete}
var QueueEverything []QueuePermission = []QueuePermission{QueueEnqueue, QueueDequeue}
var SecretEverything []SecretPermission = []SecretPermission{SecretAccess, SecretPut}
Functions ¶
Types ¶
type Api ¶
type Api interface { Get(path string, handler handler.HttpMiddleware, opts ...MethodOption) Put(path string, handler handler.HttpMiddleware, opts ...MethodOption) Patch(path string, handler handler.HttpMiddleware, opts ...MethodOption) Post(path string, handler handler.HttpMiddleware, opts ...MethodOption) Delete(path string, handler handler.HttpMiddleware, opts ...MethodOption) Options(path string, handler handler.HttpMiddleware, opts ...MethodOption) NewRoute(path string, middleware ...handler.HttpMiddleware) Route }
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 handler.ComposeHttpMiddlware()
type ApiDetails ¶
type ApiOption ¶
type ApiOption = func(api *api)
func WithMiddleware ¶
func WithMiddleware(middleware ...handler.HttpMiddleware) ApiOption
func WithSecurity ¶
func WithSecurity(oidcOptions OidcOptions) ApiOption
func WithSecurityJwtRule ¶
func WithSecurityJwtRule(name string, rule JwtSecurityRule) ApiOption
type Bucket ¶
type Bucket interface { Allow(BucketPermission, ...BucketPermission) (storage.Bucket, error) On(handler.BlobEventType, string, ...handler.BlobEventMiddleware) }
type BucketPermission ¶
type BucketPermission string
const ( BucketRead BucketPermission = "read" BucketWrite BucketPermission = "write" BucketDelete BucketPermission = "delete" )
type JwtSecurityRule ¶
type KvStore ¶ added in v1.0.0
type KvStore interface {
Allow(KvStorePermission, ...KvStorePermission) (keyvalue.Store, error)
}
type KvStorePermission ¶ added in v1.0.0
type KvStorePermission string
const ( KvStoreWrite KvStorePermission = "write" KvStoreRead KvStorePermission = "read" KvStoreDelete KvStorePermission = "delete" )
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(oidcOptions OidcOptions) MethodOption
func WithNoMethodSecurity ¶
func WithNoMethodSecurity() MethodOption
type OidcOptions ¶ added in v1.0.0
type OidcSecurityDefinition ¶ added in v1.0.0
type OidcSecurityDefinition interface{}
func NewOidcSecurityDefinition ¶ added in v1.0.0
func NewOidcSecurityDefinition(apiName string, options OidcOptions) (OidcSecurityDefinition, error)
type Queue ¶
type Queue interface {
Allow(QueuePermission, ...QueuePermission) (queues.Queue, error)
}
type QueuePermission ¶
type QueuePermission string
const ( QueueEnqueue QueuePermission = "enqueue" QueueDequeue QueuePermission = "dequeue" )
type Route ¶
type Route interface { All(handler handler.HttpMiddleware, opts ...MethodOption) Get(handler handler.HttpMiddleware, opts ...MethodOption) Patch(handler handler.HttpMiddleware, opts ...MethodOption) Put(handler handler.HttpMiddleware, opts ...MethodOption) Post(handler handler.HttpMiddleware, opts ...MethodOption) Delete(handler handler.HttpMiddleware, opts ...MethodOption) Options(handler handler.HttpMiddleware, opts ...MethodOption) ApiName() string }
Route providers convenience functions to register a handler in a single method.
type Schedule ¶
type Schedule interface { Cron(cron string, middleware ...handler.IntervalMiddleware) Every(rate string, middleware ...handler.IntervalMiddleware) }
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 ( SecretAccess SecretPermission = "access" SecretPut SecretPermission = "put" )
type SecurityOption ¶ added in v1.0.0
type SecurityOption = func(scopes []string) OidcOptions
type SubscribableTopic ¶
type SubscribableTopic interface { Allow(TopicPermission, ...TopicPermission) (Topic, error) // Subscribe will register and start a subscription handler that will be called for all events from this topic. Subscribe(...handler.MessageMiddleware) }
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. TopicPublish TopicPermission = "publish" )
type Websocket ¶
type Websocket interface { Name() string On(eventType handler.WebsocketEventType, mwares ...handler.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.