Documentation ¶
Index ¶
- func Call[Req, Resp any](ctx context.Context, verb Verb[Req, Resp], req Req) (resp Resp, err error)
- func PostgresDatabase(name string) *sql.DB
- type AbstractRef
- type Any
- type ConfigType
- type ConfigValue
- type DataRef
- type Logger
- type Option
- func (o Option[T]) Default(value T) T
- func (o Option[T]) Get() (T, bool)
- func (o Option[T]) GoString() string
- func (o Option[T]) MarshalJSON() ([]byte, error)
- func (o Option[T]) MustGet() T
- func (o Option[T]) Ok() bool
- func (o Option[T]) Ptr() *T
- func (o *Option[T]) Scan(src any) error
- func (o Option[T]) String() string
- func (o *Option[T]) UnmarshalJSON(data []byte) error
- func (o Option[T]) Value() (driver.Value, error)
- type Ref
- type SecretType
- type SecretValue
- type Sink
- type SinkRef
- type Source
- type SourceRef
- type Unit
- type Verb
- type VerbRef
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PostgresDatabase ¶
PostgresDatabase returns a Postgres database connection for the named database.
Types ¶
type AbstractRef ¶
AbstractRef is an abstract reference to a symbol.
func (*AbstractRef[Proto]) String ¶
func (v *AbstractRef[Proto]) String() string
func (*AbstractRef[Proto]) ToProto ¶
func (v *AbstractRef[Proto]) ToProto() *Proto
func (*AbstractRef[Proto]) UnmarshalText ¶
func (v *AbstractRef[Proto]) UnmarshalText(text []byte) error
type ConfigType ¶
type ConfigType interface{ any }
ConfigType is a type that can be used as a configuration value.
type ConfigValue ¶
type ConfigValue[T ConfigType] struct { // contains filtered or unexported fields }
ConfigValue is a typed configuration key for the current module.
func Config ¶
func Config[T ConfigType](name string) ConfigValue[T]
Config declares a typed configuration key for the current module.
func (*ConfigValue[T]) Get ¶
func (c *ConfigValue[T]) Get() (out T)
Get returns the value of the configuration key from FTL.
func (*ConfigValue[T]) String ¶
func (c *ConfigValue[T]) String() string
type DataRef ¶
type DataRef = AbstractRef[schemapb.DataRef]
DataRef is a reference to a Data type.
func DataRefFromProto ¶
func ParseDataRef ¶
type Logger ¶
Logger is a levelled printf-style logger with support for structured attributes.
func LoggerFromContext ¶
LoggerFromContext retrieves the current logger from the Context.
type Option ¶
type Option[T any] struct { // contains filtered or unexported fields }
An Option type is a type that can contain a value or nothing.
func Nil ¶
Nil returns an Option that is invalid if the value is nil, otherwise the value.
If the type is not nillable (slice, map, chan, ptr, interface) this will panic.
func Ptr ¶
Ptr returns an Option that is invalid if the pointer is nil, otherwise the dereferenced pointer.
func Zero ¶
Zero returns an Option that is invalid if the value is the zero value, otherwise the value.
func (Option[T]) Default ¶
func (o Option[T]) Default(value T) T
Default returns the Option value if it is present, otherwise it returns the value passed.
func (Option[T]) Get ¶
Get returns the value and a boolean indicating if the Option contains a value.
func (Option[T]) MarshalJSON ¶
func (Option[T]) MustGet ¶
func (o Option[T]) MustGet() T
MustGet returns the value. It panics if the Option contains nothing.
func (Option[T]) Ptr ¶
func (o Option[T]) Ptr() *T
Ptr returns a pointer to the value if the Option contains a value, otherwise nil.
func (*Option[T]) UnmarshalJSON ¶
type SecretType ¶
type SecretType interface{ any }
SecretType is a type that can be used as a secret value.
type SecretValue ¶
type SecretValue[Type SecretType] struct { // contains filtered or unexported fields }
SecretValue is a typed secret for the current module.
func Secret ¶
func Secret[Type SecretType](name string) SecretValue[Type]
Secret declares a typed secret for the current module.
func (*SecretValue[Type]) Get ¶
func (s *SecretValue[Type]) Get() (out Type)
Get returns the value of the secret from FTL.
func (*SecretValue[Type]) String ¶
func (s *SecretValue[Type]) String() string
type SinkRef ¶
type SinkRef = AbstractRef[schemapb.SinkRef]
func ParseSinkRef ¶
func SinkRefFromProto ¶
type SourceRef ¶
type SourceRef = AbstractRef[schemapb.SourceRef]
func ParseSourceRef ¶
func SourceRefFromProto ¶
type Unit ¶
type Unit struct{}
Unit is a type that has no value.
It can be used as a parameter or return value to indicate that a function does not accept or return any value.
type VerbRef ¶
type VerbRef = AbstractRef[schemapb.VerbRef]
VerbRef is a reference to a verb (a function in the form F(I)O).