contract

package
v0.1.928 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: Apache-2.0 Imports: 62 Imported by: 70

Documentation

Index

Constants

View Source
const (
	ExtImageJPEG = ".jpg"
	ExtImagePNG  = ".png"
	ExtVideoMP4  = ".mp4"
	ExtAudioM4A  = ".m4a"
)
View Source
const (
	CountKey                 ResultKey         = "total"
	UnionWithColl            UnionWithField    = "coll"
	UnionWithPipeline        UnionWithField    = "pipeline"
	MongoLookupFullDocument  MongoLookupTarget = "fullDocument"
	MongoLookupDocumentKey   MongoLookupTarget = "documentKey"
	MongoLookupOperationType MongoLookupTarget = "operationType"
	TypeArray                AtlasDataType     = "array"
	TypeBoolean              AtlasDataType     = "boolean"
	TypeDate                 AtlasDataType     = "date"
	TypeFacetDate            AtlasDataType     = "dateFacet"
	TypeNumber               AtlasDataType     = "number"
	TypeFacetNumber          AtlasDataType     = "numberFacet"
	TypeGeo                  AtlasDataType     = "geo"
	TypeDocument             AtlasDataType     = "document"
	TypeEmbeddedDoc          AtlasDataType     = "embeddedDocument"
	TypeObjectID             AtlasDataType     = "objectId"
	TypeString               AtlasDataType     = "string"
	TypeFacetString          AtlasDataType     = "stringFacet"
	TypeAutocomplete         AtlasDataType     = "autocomplete"
	TypeToken                AtlasDataType     = "token"
	VerbElemMatch            MongoVerb         = "$elemMatch"
	VerbMatch                MongoVerb         = "$match"
	VerbSkip                 MongoVerb         = "$skip"
	VerbLimit                MongoVerb         = "$limit"
	VerbSort                 MongoVerb         = "$sort"
	VerbCount                MongoVerb         = "$count"
	VerbSearch               MongoVerb         = "$search"
	VerbVectorSearch         MongoVerb         = "$vectorSearch"
	VerbUnionWith            MongoVerb         = "$unionWith"
	OpAnd                    BSONOperator      = "$and"
	OpOr                     BSONOperator      = "$or"
	OpNor                    BSONOperator      = "$nor"
	OpGT                     BSONOperator      = "$gt"
	OpGTE                    BSONOperator      = "$gte"
	OpLT                     BSONOperator      = "$lt"
	OpLTE                    BSONOperator      = "$lte"
	OpNE                     BSONOperator      = "$ne"
	OpIn                     BSONOperator      = "$in"
	OpNin                    BSONOperator      = "$nin"
	Ascending                SortDirection     = 1
	Descending               SortDirection     = -1
	MatchAll                 MatchBehavior     = "$all"
	MatchIn                  MatchBehavior     = "$in"
	MatchEqual               MatchBehavior     = "$eq"
	FieldQueryVector         VectorSearchField = "queryVector"
	FieldIndex               VectorSearchField = "index"
	FieldPath                VectorSearchField = "path"
	FieldExact               VectorSearchField = "exact"
	FieldNumCandidates       VectorSearchField = "numCandidates"
	FieldLimit               VectorSearchField = "limit"
	FieldFilter              VectorSearchField = "filter"
)
View Source
const (
	SearchQueryKey   = "q"
	SearchPageKey    = "page"
	SearchPerPageKey = "per_page"
)
View Source
const DefaultIndent = "  "
View Source
const (
	IDKey = "id"
)
View Source
const (
	SessionTokenKey = "session_token"
)

Variables

View Source
var (
	// AdjustmentTypeRate represents an adjustment computed as a percentage of gross pay.
	AdjustmentTypeRate = adjustmentType("rate")
	// AdjustmentTypePerPeriod represents an adjustment applied once per period.
	AdjustmentTypePerPeriod = adjustmentType("perperiod")
	// AdjustmentTypePerHour represents an adjustment computed from an hourly amount.
	AdjustmentTypePerHour = adjustmentType("perhour")
)
View Source
var (
	ReembedNamespace            = claimRunNamespace("reembed")
	StatsPopNamespace           = claimRunNamespace("statspop")
	AbsorbLoadNamespace         = claimRunNamespace("absorbload")
	UpdateItemQuantityNamespace = claimRunNamespace("updateitemquantity")
	PSPWebhookSyncNamespace     = claimRunNamespace("pspwebhooksync")
)
View Source
var (
	BillFixed   = billType("fixed")
	BillDynamic = billType("dynamic")
)
View Source
var (
	ChargeItem      = chargeType("item")
	ChargeEquipment = chargeType("equipment")
)
View Source
var (
	PathSearch = path("search")
	PathPull   = path("pull")
)
View Source
var (
	PSPEventTypeAccountUpdated              = pspEventType(string(stripeApi.EventTypeAccountUpdated))
	PSPEventTypePaymentIntentPaymentFailed  = pspEventType(string(stripeApi.EventTypePaymentIntentPaymentFailed))
	PSPEventTypePaymentIntentProcessing     = pspEventType(string(stripeApi.EventTypePaymentIntentProcessing))
	PSPEventTypePaymentIntentRequiresAction = pspEventType(string(stripeApi.EventTypePaymentIntentRequiresAction))
	PSPEventTypePaymentIntentSucceeded      = pspEventType(string(stripeApi.EventTypePaymentIntentSucceeded))
	PSPEventTypePaymentIntentCanceled       = pspEventType(string(stripeApi.EventTypePaymentIntentCanceled))
	PSPEventTypeRefundUpdated               = pspEventType(string(stripeApi.EventTypeRefundUpdated))
	PSPEventTypeSetupIntentCanceled         = pspEventType(string(stripeApi.EventTypeSetupIntentCanceled))
	PSPEventTypeSetupIntentSucceeded        = pspEventType(string(stripeApi.EventTypeSetupIntentSucceeded))
	PSPEventTypeSetupIntentRequiresAction   = pspEventType(string(stripeApi.EventTypeSetupIntentRequiresAction))
	PSPEventTypeSetupIntentFailed           = pspEventType(string(stripeApi.EventTypeSetupIntentSetupFailed))
	PSPEventTypeBankAccountCreated          = pspEventType(string(stripeApi.EventTypeAccountExternalAccountCreated))
)
View Source
var (
	PSPExpiryStatusActive      = pspExpiryStatus("active")
	PSPExpiryStatusPending     = pspExpiryStatus("pending")
	PSPExpiryStatusExpired     = pspExpiryStatus("expired")
	PSPExpiryStatusExpiresSoon = pspExpiryStatus("expires_soon")
)
View Source
var (
	PSPActionableStatusFailed                = pspActionableStatus("failed")
	PSPActionableStatusRequiresPaymentMethod = pspActionableStatus("requires_payment_method")
	PSPActionableStatusRequiresConfirmation  = pspActionableStatus("requires_confirmation")
	PSPActionableStatusRequiresAction        = pspActionableStatus("requires_action")
	PSPActionableStatusProcessing            = pspActionableStatus("processing")
	PSPActionableStatusRequiresCapture       = pspActionableStatus("requires_capture")
	PSPActionableStatusCanceled              = pspActionableStatus("canceled")
	PSPActionableStatusSucceeded             = pspActionableStatus("succeeded")
)
View Source
var (
	PSPRefundReasonDuplicate           = pspRefundReason(string(stripeApi.RefundReasonDuplicate))
	PSPRefundReasonRequestedByCustomer = pspRefundReason(string(stripeApi.RefundReasonRequestedByCustomer))
)
View Source
var (
	PSPPaymentStatusPending = pspPaymentStatus("pending")
	PSPPaymentStatusPartial = pspPaymentStatus("partial")
	PSPPaymentStatusFull    = pspPaymentStatus("full")
)
View Source
var (
	PSPFeesPayerSender   = pspFeesPayer("sender")
	PSPFeesPayerReceiver = pspFeesPayer("receiver")
)
View Source
var (
	PaymentEntityTypeBill    = paymentEntityType("bill")
	PaymentEntityTypePayroll = paymentEntityType("payroll")
)
View Source
var (
	PSPBankAccountHolderTypeIndividual = pspBankAccountHolderType(string(stripeApi.BankAccountAccountHolderTypeIndividual))
	PSPBankAccountHolderTypeCompany    = pspBankAccountHolderType(string(stripeApi.BankAccountAccountHolderTypeCompany))
)
View Source
var (
	PayTypePerHour = payType("perhour")
	PayTypeFixed   = payType("fixed")
)
View Source
var (
	PostTypeEmployment = postType("employment")
	PostTypeJob        = postType("job")
)
View Source
var (
	Daily            = recurrenceType("daily")
	Weekly           = recurrenceType("weekly")
	Monthly          = recurrenceType("monthly")
	Yearly           = recurrenceType("yearly")
	Indefinite       = recurrenceEndType("indefinite")
	AfterOccurrences = recurrenceEndType("after_occurrences")
	AfterDate        = recurrenceEndType("after_date")
)
View Source
var (
	Pending    = status("pending")
	Started    = status("started")
	Terminated = status("terminated")
)
View Source
var (
	StripeMetaPaymentIntentSeparatedFees = stripeMetadataKey("payment_intent_separated_fees")
	StripeMetaSetupIntentAccountID       = stripeMetadataKey("setup_intent_account_id")
	StripeMetaBankAccountFromApp         = stripeMetadataKey("bank_account_from_app")
	StripeMetaWebhookSyncToken           = stripeMetadataKey("webhook_sync_token")
)
View Source
var (
	SysboxPathTemplates   = SysboxPathFn("src", "template", "*.html")
	SysboxPathQRWatermark = SysboxPathFn("src", "watermark", "white-head.png")
)
View Source
var (
	PunchTypeIn         = punchType("in")
	PunchTypeOut        = punchType("out")
	PunchTypeRideIn     = punchType("ride_in")
	PunchTypeRideOut    = punchType("ride_out")
	PunchStatusWorking  = punchStatus("working")
	PunchStatusPending  = punchStatus("pending")
	PunchStatusApproved = punchStatus("approved")
	PunchModeDefault    = punchMode("default")
	PunchModeReplace    = punchMode("replace")
	PunchModeDelete     = punchMode("delete")
	PunchModeWeekSheet  = punchMode("weeksheet")
)
View Source
var (
	CallEventConnected    = callEvent("connected")
	CallEventDisconnected = callEvent("disconnected")
	CallEventCallEnded    = callEvent("ended")
)
View Source
var (
	UserTypeEmployer = userType("employer")
	UserTypeEmployee = userType("employee")
	UserTypeClient   = userType("client")
	UserTypeExternal = userType("external")
)
View Source
var (
	ModText  = modality("text")
	ModImage = modality("image")
	ModVideo = modality("video")
	ModNA    = modality("N/A")
)
View Source
var (
	Fixed    = worksiteType("fixed")
	Floating = worksiteType("floating")
)
View Source
var SearchRules = QueryParamRules{
	{
		Key:                   SearchQueryKey,
		DefaultValue:          "",
		MultipleValuesAllowed: false,
		Optional:              false,
	},
	{
		Key:                   SearchPageKey,
		DefaultValue:          "",
		MultipleValuesAllowed: false,
		Optional:              false,
	},
	{
		Key:                   SearchPerPageKey,
		DefaultValue:          "",
		MultipleValuesAllowed: false,
		Optional:              false,
	},
}

SearchRules defines validation rules for search queries.

Functions

func Apply added in v0.1.795

func Apply[T any](o *T, mods ...Opt[T]) T

func DefaultGRPCClientOptions added in v0.1.561

func DefaultGRPCClientOptions(credentialsJSON []byte) []option.ClientOption

DefaultGRPCClientOptions returns safe gRPC dial options for long-lived connections.

func ExtractAuthToken added in v0.1.178

func ExtractAuthToken(r *http.Request, opts AuthOptions) (string, error)

ExtractAuthToken extracts the auth token from the request header.

func IDRegistrar added in v0.1.317

func IDRegistrar(reg *bson.Registry)

func NewIDKey added in v0.1.772

func NewIDKey(prefix string) string

func ParseOperationResultToSingle added in v0.1.358

func ParseOperationResultToSingle[T any](ctx context.Context, res *OperationResult, recv T, m Marshaler, u Unmarshaler) (T, error)

ParseOperationResultToSingle unmarshals a single item from the operation result into receiver (must be a pointer).

func ParseOperationResultToSlice added in v0.1.358

func ParseOperationResultToSlice[T any](ctx context.Context, res *OperationResult, recv *[]T, m Marshaler, u Unmarshaler) ([]T, error)

ParseOperationResultToSlice unmarshals a slice of items from the operation result into receiver (must be a pointer to a slice).

func ParseOperationResultToSliceDynamic added in v0.1.416

func ParseOperationResultToSliceDynamic(ctx context.Context, res *OperationResult, recv any, m Marshaler, u Unmarshaler) ([]any, error)

ParseOperationResultToSliceDynamic unmarshals a slice of items from the operation result using reflection (receiver must be pointer to a slice of pointers).

func PathKey added in v0.1.838

func PathKey(sep string, parts ...string) string

PathKey joins non-empty trimmed parts with the given separator.

func PathKeyDot added in v0.1.838

func PathKeyDot(parts ...string) string

PathKeyDot joins non-empty trimmed parts with a dot.

func PathKeyFn added in v0.1.838

func PathKeyFn(key string) func(...string) string

PathKeyFn creates a dotted field-path function that appends key after any given prefixes.

Types

type AddStripeCardOption added in v0.1.843

type AddStripeCardOption = Opt[AddStripeCardOptions]

func WithAddStripeCardBillingDetailsEmail added in v0.1.843

func WithAddStripeCardBillingDetailsEmail(x string) AddStripeCardOption

func WithAddStripeCardBillingDetailsName added in v0.1.843

func WithAddStripeCardBillingDetailsName(x string) AddStripeCardOption

func WithAddStripeCardConnectedAccountID added in v0.1.845

func WithAddStripeCardConnectedAccountID(x *ID) AddStripeCardOption

func WithAddStripeCardMetadata added in v0.1.923

func WithAddStripeCardMetadata(x map[string]string) AddStripeCardOption

func WithAddStripeCardPostalCode added in v0.1.843

func WithAddStripeCardPostalCode(x string) AddStripeCardOption

func WithAddStripeCardToken added in v0.1.843

func WithAddStripeCardToken(x string) AddStripeCardOption

type AddStripeCardOptions added in v0.1.843

type AddStripeCardOptions struct {
	StripeConnectedAccountID
	Token               string
	BillingDetailsEmail string
	BillingDetailsName  string
	PostalCode          string
	Metadata            map[string]string
}

func ApplyAddStripeCardOptions added in v0.1.843

func ApplyAddStripeCardOptions(opts *AddStripeCardOptions, modifiers ...AddStripeCardOption) AddStripeCardOptions

func (*AddStripeCardOptions) Params added in v0.1.845

func (*AddStripeCardOptions) Validate added in v0.1.843

func (o *AddStripeCardOptions) Validate() error

type AdjustmentType added in v0.1.829

type AdjustmentType string

func (*AdjustmentType) Validate added in v0.1.829

func (x *AdjustmentType) Validate() error

type ArbiterBillable added in v0.1.922

type ArbiterBillable interface {
	ClaimRunUpdateItemQuantity(ctx context.Context, opts ClaimRunUpdateItemQuantityOptions) (bool, error)
}

type ArbiterFeed added in v0.1.922

type ArbiterFeed interface {
	ClaimRunReembed(ctx context.Context, opts ClaimRunReembedOptions) (bool, error)
	ClaimRunStatsPop(ctx context.Context, opts ClaimRunStatsPopOptions) (bool, error)
}

type ArbiterIDReembedding added in v0.1.726

type ArbiterIDReembedding struct {
	EntityID string
	M        Modality
}

func (ArbiterIDReembedding) String added in v0.1.726

func (a ArbiterIDReembedding) String() string

func (*ArbiterIDReembedding) Validate added in v0.1.726

func (a *ArbiterIDReembedding) Validate() error

type ArbiterOperator added in v0.1.726

type ArbiterOperator interface {
	CloserWithCtx
	ArbiterFeed
	ArbiterBillable
	ArbiterPayments
	ArbiterTokenizer
	Claim(ctx context.Context, c fmt.Stringer, owner string) (bool, error)
	Release(ctx context.Context, c fmt.Stringer, owner string) error
	Extend(ctx context.Context, c fmt.Stringer, owner string) (bool, error)
	ClaimRun(ctx context.Context, opts ClaimRunOptions) (bool, error)
	AbsorbLoad(ctx context.Context, c fmt.Stringer, ttl time.Duration) (bool, error)
}

type ArbiterPayments added in v0.1.922

type ArbiterPayments interface {
	ClaimRunPSPWebhookSync(ctx context.Context, opts ClaimRunPSPWebhookSyncOptions) (bool, error)
}

type ArbiterTokenizer added in v0.1.924

type ArbiterTokenizer interface {
	NewToken(ctx context.Context) (string, error)
}

type AtlasDataType added in v0.0.5

type AtlasDataType = string

AtlasDataType represents the data types recognized by MongoDB Atlas.

type AtlasIndexes added in v0.1.77

type AtlasIndexes map[string]string

AtlasIndexes is a map of field name to MongoDB Atlas data type.

type Atz added in v0.1.271

type Atz struct {
	Authorize bool
}

Atz controls whether the authorization step should be executed in the handler.

type AudioOptions added in v0.1.498

type AudioOptions struct {
	Name       string
	SampleRate uint32
	BitRate    string
}

type AuthOption added in v0.1.177

type AuthOption = Opt[AuthOptions]

func WithAuthorizationHeaderKey added in v0.1.178

func WithAuthorizationHeaderKey(x string) AuthOption

func WithPrefix added in v0.1.177

func WithPrefix(x string) AuthOption

type AuthOptions added in v0.1.177

type AuthOptions struct {
	AuthorizationHeaderKey string
	Prefix                 string
}

AuthOptions holds authentication-related configuration used across multiple systems, including OIDC & Firebase.

func ApplyAuthOptions added in v0.1.177

func ApplyAuthOptions(opts *AuthOptions, modifiers ...AuthOption) AuthOptions

type AuthenticationOperator added in v0.1.178

type AuthenticationOperator interface {
	FirebaseAuthenticator
	OIDCAuthenticator
	AuthenticateWithSecret(ctx context.Context, r *http.Request, opts AuthOptions) error
	AuthenticateAny(ctx context.Context, r *http.Request, opts AuthOptions) error
}

type Authorizable added in v0.1.54

type Authorizable interface {
	Readers() []*ID
	Writers() []*ID
	Owners() []*ID
}

type AuthorizationResult added in v0.1.56

type AuthorizationResult struct {
	UnallowedRecords []ID `json:"unallowed_records"`
}

AuthorizationResult represents an authorization response.

func NewAuthorizationResult added in v0.1.57

func NewAuthorizationResult(opts ...AuthorizationResultOption) *AuthorizationResult

type AuthorizationResultOption added in v0.1.56

type AuthorizationResultOption = Opt[AuthorizationResult]

func WithUnallowedRecords added in v0.1.233

func WithUnallowedRecords(x []ID) AuthorizationResultOption

type AutoCensorOption added in v0.1.764

type AutoCensorOption = Opt[AutoCensorOptions]

func WithAutoCensorCensorRLRPermille added in v0.1.768

func WithAutoCensorCensorRLRPermille(x int64) AutoCensorOption

func WithAutoCensorMaxReportsAbs added in v0.1.764

func WithAutoCensorMaxReportsAbs(x int64) AutoCensorOption

func WithAutoCensorMinLikesForAutoCensor added in v0.1.764

func WithAutoCensorMinLikesForAutoCensor(x int64) AutoCensorOption

func WithAutoCensorMinReportsForCheck added in v0.1.764

func WithAutoCensorMinReportsForCheck(x int64) AutoCensorOption

func WithAutoCensorUncensorRLRPermille added in v0.1.768

func WithAutoCensorUncensorRLRPermille(x int64) AutoCensorOption

type AutoCensorOptions added in v0.1.764

type AutoCensorOptions struct {
	MinLikesForAutoCensor int64
	MinReportsForCheck    int64
	MaxReportsAbs         int64
	CensorRLRPermille     int64
	UncensorRLRPermille   int64
}

func ApplyAutoCensorOptions added in v0.1.764

func ApplyAutoCensorOptions(opts *AutoCensorOptions, modifiers ...AutoCensorOption) AutoCensorOptions

func (*AutoCensorOptions) Validate added in v0.1.764

func (o *AutoCensorOptions) Validate() error

type BSONOperator added in v0.0.5

type BSONOperator = string

BSONOperator represents BSON query operators in MongoDB.

type Base64Decoder added in v0.0.5

type Base64Decoder interface {
	DecodeString(enc *base64.Encoding, src string) ([]byte, error)
}

type BasisInt added in v0.1.10

type BasisInt = int

type BasisInt32 added in v0.1.10

type BasisInt32 = int32

type BasisInt64 added in v0.1.10

type BasisInt64 = int64

type BasisOperator added in v0.1.10

type BasisOperator interface {
	BasisIntToMajor(ctx context.Context, b BasisInt, c ConversionFactor) (MajorUnit, error)
	BasisInt32ToMajor(ctx context.Context, b BasisInt32, c ConversionFactor) (MajorUnit, error)
	BasisInt64ToMajor(ctx context.Context, b BasisInt64, c ConversionFactor) (MajorUnit, error)
	MajorToBasis(ctx context.Context, m MajorUnit, c ConversionFactor) (BasisInt64, error)
}

type BatchSendResult added in v0.1.583

type BatchSendResult struct {
	SuccessCount uint32
	FailureCount uint32
	Results      []SendResult
}

type BillType added in v0.1.809

type BillType string

BillType represents the nature of a bill.

func (*BillType) Validate added in v0.1.809

func (x *BillType) Validate() error

type Billable added in v0.1.822

type Billable interface {
	SetIsBilled(x bool)
}

type Blob added in v0.1.699

type Blob struct{}

type BucketFile added in v0.1.477

type BucketFile struct {
	OriginalName string
	ObjectName   string
	MimePrefix   string
	MIME         string
	Extension    string
	Body         io.Reader
	FullQuality  bool
}

BucketFile represents a file to be uploaded to a bucket with its metadata.

func (*BucketFile) Validate added in v0.1.479

func (b *BucketFile) Validate(allowEmptyObjectName bool) error

type BucketOperator added in v0.1.479

type BucketOperator interface {
	NewSignedURLOptions(ctx context.Context, expire bool) (*storage.SignedURLOptions, error)
	DefaultBucketAttrs(ctx context.Context, lc *storage.Lifecycle) (*storage.BucketAttrs, error)
	EnsureBucket(ctx context.Context, opts EnsureBucketOptions) (*storage.BucketAttrs, error)
	NewObjectQuery(ctx context.Context, parts ...string) (*storage.Query, error)
	BuildObjectPath(ctx context.Context, parts ...string) (string, error)
	UploadObject(ctx context.Context, opts UploadObjectOptions) error
	UploadObjects(ctx context.Context, opts UploadObjectsOptions) error
	DeleteObjectByName(ctx context.Context, bucketName string, objectName string) error
	DeleteObjectsByQuery(ctx context.Context, bucketName string, query *storage.Query) error
	FindObjects(ctx context.Context, opts FindObjectsOptions) ([]*storage.ObjectAttrs, error)
	GenerateSignedObjectURLs(ctx context.Context, opts GenerateSignedObjectURLsOptions) ([]string, error)
	GenerateBucketName(ctx context.Context, e EnvironmentOperator, suffix string) (string, error)
	CloserWithCtx
}

type BucketScan added in v0.1.477

type BucketScan struct {
	// F is a reference to the scanned file.
	F           *BucketFile
	IsForbidden bool
}

BucketScan represents the result of a file scan.

type Bypass added in v0.1.359

type Bypass struct {
	InsertedID *ID
	PathID     *string
	Ressource  *string
	Compute    bool
	Cache      bool
	FillNil    bool
}

Bypass allows explicit override of default handler behavior such as skipping path extraction.

type C added in v0.1.416

type C struct {
	Svc        string
	Collection string
	R          *http.Request
	Receiver   any
	Mock       any
}

func (*C) Validate added in v0.1.416

func (o *C) Validate() error

type CacheHit added in v0.0.5

type CacheHit struct {
	V string `json:"v"`
}

CacheHit represents a cache entry that holds a JSON string.

type CacheHitter added in v0.0.5

type CacheHitter interface {
	DecodeHit(ctx context.Context, c CacheHit, dst any) error
	HitFromValue(ctx context.Context, v any) (*CacheHit, error)
}

type CacheID added in v0.0.5

type CacheID string

func (CacheID) String added in v0.0.5

func (c CacheID) String() string

type CacheIdentifier added in v0.0.5

type CacheIdentifier interface {
	CacheID(ctx context.Context, id string) (CacheID, error)
}

type CacheKey added in v0.0.5

type CacheKey struct {
	ID           fmt.Stringer
	Microservice string
	Collection   string
	Multi        *CacheMulti
}

CacheKey represents a cache key. It is used to identify a cache entry & it can be used to generate a matching pattern using wildcards.

func AbsorbLoadKey added in v0.1.773

func AbsorbLoadKey(svc string, parts ...string) CacheKey

func (CacheKey) String added in v0.0.5

func (c CacheKey) String() string

String implements the Stringer interface for Key.

type CacheMulti added in v0.0.5

type CacheMulti struct {
	RawQuery string
}

type CacheOperator added in v0.0.5

type CacheOperator interface {
	CacheIdentifier
	CacheHitter
	Cacher
}

type Cacher added in v0.0.5

type Cacher interface {
	Get(ctx context.Context, c fmt.Stringer) (*CacheHit, error)
	Set(ctx context.Context, c fmt.Stringer, v CacheHit) error
	BatchGet(ctx context.Context, c []fmt.Stringer) ([]CacheHit, error)
	BatchSet(ctx context.Context, e map[fmt.Stringer]CacheHit) error
	Flush(ctx context.Context, c fmt.Stringer) error
	BatchFlush(ctx context.Context, c []fmt.Stringer) error
	FlushAll(ctx context.Context) error
	Exists(ctx context.Context, c fmt.Stringer) (bool, error)
}

type CallEvent added in v0.1.796

type CallEvent = string

type Captioner added in v0.1.756

type Captioner interface {
	CaptionImages(ctx context.Context, imgs []MediaInput) ([]string, error)
	DescribeVideos(ctx context.Context, vids []MediaInput) ([]string, error)
}

type CaptionerOperator added in v0.1.756

type CaptionerOperator interface {
	Captioner
}

type CardExpiryLead added in v0.1.911

type CardExpiryLead time.Duration

CardExpiryLead represents a lead duration applied before card expiration.

func (*CardExpiryLead) Validate added in v0.1.911

func (x *CardExpiryLead) Validate() error

type CertGenerator added in v0.0.5

type CertGenerator interface {
	X509KeyPair(ctx context.Context, certPEMBlock []byte, keyPEMBlock []byte) (tls.Certificate, error)
	AppendCertsFromPEM(ctx context.Context, pool *x509.CertPool, pemCerts []byte) (bool, error)
}

type ChangeEvent added in v0.0.5

type ChangeEvent struct {
	OperationType string `json:"operation_type"`
	FullDocument  any    `json:"full_document"`
}

type ChargeType added in v0.1.807

type ChargeType string

ChargeType represents the nature of a charge.

func (*ChargeType) Validate added in v0.1.808

func (x *ChargeType) Validate() error

type Chargeable added in v0.1.816

type Chargeable interface {
	GetPrice() int64
	GetName() string
	GetQuantifierID() ID
}

type ClaimFunc added in v0.1.726

type ClaimFunc func(context.Context) error

type ClaimRunNamespace added in v0.1.773

type ClaimRunNamespace = string

type ClaimRunOption added in v0.1.726

type ClaimRunOption = Opt[ClaimRunOptions]

func WithClaimRunFn added in v0.1.726

func WithClaimRunFn(x ClaimFunc) ClaimRunOption

func WithClaimRunKey added in v0.1.726

func WithClaimRunKey(x fmt.Stringer) ClaimRunOption

func WithClaimRunWait added in v0.1.922

func WithClaimRunWait(x bool) ClaimRunOption

func WithClaimRunWaitTimeout added in v0.1.922

func WithClaimRunWaitTimeout(x time.Duration) ClaimRunOption

type ClaimRunOptions added in v0.1.726

type ClaimRunOptions struct {
	Key         fmt.Stringer
	Fn          ClaimFunc
	Wait        bool
	WaitTimeout time.Duration
}

func ApplyClaimRunOptions added in v0.1.726

func ApplyClaimRunOptions(opts *ClaimRunOptions, modifiers ...ClaimRunOption) ClaimRunOptions

func (*ClaimRunOptions) Validate added in v0.1.726

func (c *ClaimRunOptions) Validate() error

type ClaimRunPSPWebhookSyncOption added in v0.1.922

type ClaimRunPSPWebhookSyncOption = Opt[ClaimRunPSPWebhookSyncOptions]

func WithClaimRunPSPWebhookSyncFn added in v0.1.922

func WithClaimRunPSPWebhookSyncFn(x ClaimFunc) ClaimRunPSPWebhookSyncOption

func WithClaimRunPSPWebhookSyncService added in v0.1.922

func WithClaimRunPSPWebhookSyncService(x string) ClaimRunPSPWebhookSyncOption

func WithClaimRunPSPWebhookSyncToken added in v0.1.922

func WithClaimRunPSPWebhookSyncToken(x *ID) ClaimRunPSPWebhookSyncOption

func WithClaimRunPSPWebhookSyncWait added in v0.1.922

func WithClaimRunPSPWebhookSyncWait(x bool) ClaimRunPSPWebhookSyncOption

func WithClaimRunPSPWebhookSyncWaitTimeout added in v0.1.922

func WithClaimRunPSPWebhookSyncWaitTimeout(x time.Duration) ClaimRunPSPWebhookSyncOption

type ClaimRunPSPWebhookSyncOptions added in v0.1.922

type ClaimRunPSPWebhookSyncOptions struct {
	Service     string
	Token       *ID
	Fn          ClaimFunc
	Wait        bool
	WaitTimeout time.Duration
}

func ApplyClaimRunPSPWebhookSyncOptions added in v0.1.922

func ApplyClaimRunPSPWebhookSyncOptions(opts *ClaimRunPSPWebhookSyncOptions, modifiers ...ClaimRunPSPWebhookSyncOption) ClaimRunPSPWebhookSyncOptions

func (*ClaimRunPSPWebhookSyncOptions) Validate added in v0.1.922

func (c *ClaimRunPSPWebhookSyncOptions) Validate() error

type ClaimRunReembedOption added in v0.1.726

type ClaimRunReembedOption = Opt[ClaimRunReembedOptions]

func WithClaimRunReembedFn added in v0.1.726

func WithClaimRunReembedFn(x ClaimFunc) ClaimRunReembedOption

func WithClaimRunReembedID added in v0.1.726

func WithClaimRunReembedID(x ArbiterIDReembedding) ClaimRunReembedOption

func WithClaimRunReembedService added in v0.1.726

func WithClaimRunReembedService(x string) ClaimRunReembedOption

type ClaimRunReembedOptions added in v0.1.726

type ClaimRunReembedOptions struct {
	Service string
	ID      ArbiterIDReembedding
	Fn      ClaimFunc
}

func ApplyClaimRunReembedOptions added in v0.1.726

func ApplyClaimRunReembedOptions(opts *ClaimRunReembedOptions, modifiers ...ClaimRunReembedOption) ClaimRunReembedOptions

func (*ClaimRunReembedOptions) Validate added in v0.1.726

func (c *ClaimRunReembedOptions) Validate() error

type ClaimRunStatsPopOption added in v0.1.773

type ClaimRunStatsPopOption = Opt[ClaimRunStatsPopOptions]

func WithClaimRunStatsPopFn added in v0.1.773

func WithClaimRunStatsPopFn(x ClaimFunc) ClaimRunStatsPopOption

func WithClaimRunStatsPopPostID added in v0.1.773

func WithClaimRunStatsPopPostID(x *ID) ClaimRunStatsPopOption

func WithClaimRunStatsPopService added in v0.1.773

func WithClaimRunStatsPopService(x string) ClaimRunStatsPopOption

type ClaimRunStatsPopOptions added in v0.1.773

type ClaimRunStatsPopOptions struct {
	Service string
	PostID  *ID
	Fn      ClaimFunc
}

func ApplyClaimRunStatsPopOptions added in v0.1.773

func ApplyClaimRunStatsPopOptions(opts *ClaimRunStatsPopOptions, modifiers ...ClaimRunStatsPopOption) ClaimRunStatsPopOptions

func (*ClaimRunStatsPopOptions) Validate added in v0.1.773

func (c *ClaimRunStatsPopOptions) Validate() error

type ClaimRunUpdateItemQuantityOption added in v0.1.823

type ClaimRunUpdateItemQuantityOption = Opt[ClaimRunUpdateItemQuantityOptions]

func WithClaimRunUpdateItemQuantityFn added in v0.1.823

func WithClaimRunUpdateItemQuantityFn(x ClaimFunc) ClaimRunUpdateItemQuantityOption

func WithClaimRunUpdateItemQuantityItemID added in v0.1.823

func WithClaimRunUpdateItemQuantityItemID(x *ID) ClaimRunUpdateItemQuantityOption

func WithClaimRunUpdateItemQuantityService added in v0.1.824

func WithClaimRunUpdateItemQuantityService(x string) ClaimRunUpdateItemQuantityOption

type ClaimRunUpdateItemQuantityOptions added in v0.1.823

type ClaimRunUpdateItemQuantityOptions struct {
	Service string
	ItemID  *ID
	Fn      ClaimFunc
}

func ApplyClaimRunUpdateItemQuantityOptions added in v0.1.823

func ApplyClaimRunUpdateItemQuantityOptions(opts *ClaimRunUpdateItemQuantityOptions, modifiers ...ClaimRunUpdateItemQuantityOption) ClaimRunUpdateItemQuantityOptions

func (*ClaimRunUpdateItemQuantityOptions) Validate added in v0.1.823

type Closer added in v0.1.13

type Closer interface {
	Close() error
}

type CloserInOut added in v0.1.381

type CloserInOut interface {
	Close(ctx context.Context, c io.Closer) error
}

type CloserWithCtx added in v0.1.13

type CloserWithCtx interface {
	Close(ctx context.Context) error
}

type ComponentExtractor added in v0.1.10

type ComponentExtractor interface {
	GetComponent(skip int, withFullFn, withFile, withFilePath, withLine bool) string
}

type CompressAudioOption added in v0.1.498

type CompressAudioOption = Opt[CompressAudioOptions]

func WithCompressAudioAudio added in v0.1.498

func WithCompressAudioAudio(x AudioOptions) CompressAudioOption

func WithCompressAudioOutputMIME added in v0.1.736

func WithCompressAudioOutputMIME(x string) CompressAudioOption

func WithCompressAudioPathInput added in v0.1.498

func WithCompressAudioPathInput(x string) CompressAudioOption

func WithCompressAudioPathOutput added in v0.1.498

func WithCompressAudioPathOutput(x string) CompressAudioOption

type CompressAudioOptions added in v0.1.498

type CompressAudioOptions struct {
	PathInput  string
	PathOutput string
	Audio      AudioOptions
	OutputMIME string
}

func ApplyCompressAudioOptions added in v0.1.498

func ApplyCompressAudioOptions(opts *CompressAudioOptions, modifiers ...CompressAudioOption) CompressAudioOptions

type CompressImageOption added in v0.1.498

type CompressImageOption = Opt[CompressImageOptions]

func WithCompressImageCompressionType added in v0.1.498

func WithCompressImageCompressionType(x string) CompressImageOption

func WithCompressImageDecrementationFactor added in v0.1.498

func WithCompressImageDecrementationFactor(x uint32) CompressImageOption

func WithCompressImageIdealSize added in v0.1.498

func WithCompressImageIdealSize(x int64) CompressImageOption

func WithCompressImageMaxIterations added in v0.1.498

func WithCompressImageMaxIterations(x uint32) CompressImageOption

func WithCompressImageMinPercentSize added in v0.1.498

func WithCompressImageMinPercentSize(x uint32) CompressImageOption

func WithCompressImageMinQuality added in v0.1.498

func WithCompressImageMinQuality(x uint32) CompressImageOption

func WithCompressImageOutputMIME added in v0.1.736

func WithCompressImageOutputMIME(x string) CompressImageOption

func WithCompressImagePathInput added in v0.1.498

func WithCompressImagePathInput(x string) CompressImageOption

func WithCompressImagePathOutput added in v0.1.498

func WithCompressImagePathOutput(x string) CompressImageOption

func WithCompressImageQuality added in v0.1.498

func WithCompressImageQuality(x uint32) CompressImageOption

func WithCompressImageSizePercent added in v0.1.498

func WithCompressImageSizePercent(x uint32) CompressImageOption

type CompressImageOptions added in v0.1.498

type CompressImageOptions struct {
	PathInput            string
	PathOutput           string
	CompressionType      string
	ImageIdealSize       int64
	Quality              uint32
	SizePercent          uint32
	DecrementationFactor uint32
	MinQuality           uint32
	MinPercentSize       uint32
	MaxIterations        uint32
	OutputMIME           string
}

func ApplyCompressImageOptions added in v0.1.498

func ApplyCompressImageOptions(opts *CompressImageOptions, modifiers ...CompressImageOption) CompressImageOptions

type CompressVideoOption added in v0.1.498

type CompressVideoOption = Opt[CompressVideoOptions]

func WithCompressVideoAudio added in v0.1.498

func WithCompressVideoAudio(x AudioOptions) CompressVideoOption

func WithCompressVideoCodec added in v0.1.498

func WithCompressVideoCodec(x VideoCodec) CompressVideoOption

func WithCompressVideoCompressionRate added in v0.1.498

func WithCompressVideoCompressionRate(x uint32) CompressVideoOption

func WithCompressVideoOutputMIME added in v0.1.736

func WithCompressVideoOutputMIME(x string) CompressVideoOption

func WithCompressVideoPathInput added in v0.1.498

func WithCompressVideoPathInput(x string) CompressVideoOption

func WithCompressVideoPathOutput added in v0.1.498

func WithCompressVideoPathOutput(x string) CompressVideoOption

func WithCompressVideoScale added in v0.1.498

func WithCompressVideoScale(x string) CompressVideoOption

type CompressVideoOptions added in v0.1.498

type CompressVideoOptions struct {
	PathInput       string
	PathOutput      string
	Scale           string
	CompressionRate uint32
	VideoCodec      VideoCodec
	Audio           AudioOptions
	OutputMIME      string
}

func ApplyCompressVideoOptions added in v0.1.498

func ApplyCompressVideoOptions(opts *CompressVideoOptions, modifiers ...CompressVideoOption) CompressVideoOptions

type ComputedHours added in v0.1.699

type ComputedHours struct {
	// Adjusted is the capped value based on employer preferences.
	Adjusted float64
	// Excess is the amount of hours exceeding the allowed threshold.
	Excess float64
}

type ConfirmStripePaymentOption added in v0.1.843

type ConfirmStripePaymentOption = Opt[ConfirmStripePaymentOptions]

func WithConfirmStripePaymentConnectedAccountID added in v0.1.845

func WithConfirmStripePaymentConnectedAccountID(x *ID) ConfirmStripePaymentOption

func WithConfirmStripePaymentPaymentIntentID added in v0.1.843

func WithConfirmStripePaymentPaymentIntentID(x *ID) ConfirmStripePaymentOption

type ConfirmStripePaymentOptions added in v0.1.843

type ConfirmStripePaymentOptions struct {
	StripeConnectedAccountID
	PaymentIntentID *ID
}

func ApplyConfirmStripePaymentOptions added in v0.1.843

func ApplyConfirmStripePaymentOptions(opts *ConfirmStripePaymentOptions, modifiers ...ConfirmStripePaymentOption) ConfirmStripePaymentOptions

func (*ConfirmStripePaymentOptions) Params added in v0.1.845

func (*ConfirmStripePaymentOptions) Validate added in v0.1.843

func (o *ConfirmStripePaymentOptions) Validate() error

type ConfirmStripeSetupIntentOption added in v0.1.843

type ConfirmStripeSetupIntentOption = Opt[ConfirmStripeSetupIntentOptions]

func WithConfirmStripeSetupIntentConnectedAccountID added in v0.1.845

func WithConfirmStripeSetupIntentConnectedAccountID(x *ID) ConfirmStripeSetupIntentOption

func WithConfirmStripeSetupIntentSetupIntentID added in v0.1.843

func WithConfirmStripeSetupIntentSetupIntentID(x *ID) ConfirmStripeSetupIntentOption

type ConfirmStripeSetupIntentOptions added in v0.1.843

type ConfirmStripeSetupIntentOptions struct {
	StripeConnectedAccountID
	SetupIntentID *ID
}

func ApplyConfirmStripeSetupIntentOptions added in v0.1.843

func ApplyConfirmStripeSetupIntentOptions(opts *ConfirmStripeSetupIntentOptions, modifiers ...ConfirmStripeSetupIntentOption) ConfirmStripeSetupIntentOptions

func (*ConfirmStripeSetupIntentOptions) Params added in v0.1.845

func (*ConfirmStripeSetupIntentOptions) Validate added in v0.1.843

func (o *ConfirmStripeSetupIntentOptions) Validate() error

type Conformer added in v0.1.336

type Conformer interface {
	Conform(ctx context.Context, v any) error
}

type ConversionFactor added in v0.1.10

type ConversionFactor = int64

type Copier added in v0.1.479

type Copier interface {
	Copy(ctx context.Context, dst io.Writer, src io.Reader) error
}

type CountFromPipelineOptions added in v0.1.771

type CountFromPipelineOptions struct {
	Collection string
	Pipeline   MongoPipeliner
	CountKey   ResultKey
}

type CreateCollectionsOptions added in v0.1.37

type CreateCollectionsOptions struct {
	Collections []string
}

type CreateIndexesOptions added in v0.1.37

type CreateIndexesOptions struct {
	Collection string
	Indexes    []IndexEntry
}

type CreateSearchIndexesOptions added in v0.1.37

type CreateSearchIndexesOptions struct {
	Collection string
	Indexes    []SearchIndexEntry
}

type CreateStripeAccountLinkOption added in v0.1.843

type CreateStripeAccountLinkOption = Opt[CreateStripeAccountLinkOptions]

func WithCreateStripeAccountLinkA added in v0.1.843

func WithCreateStripeAccountLinkA(x stripeApi.Account) CreateStripeAccountLinkOption

func WithCreateStripeAccountLinkRefreshURL added in v0.1.843

func WithCreateStripeAccountLinkRefreshURL(x string) CreateStripeAccountLinkOption

func WithCreateStripeAccountLinkReturnURL added in v0.1.843

func WithCreateStripeAccountLinkReturnURL(x string) CreateStripeAccountLinkOption

func WithCreateStripeAccountLinkType added in v0.1.843

func WithCreateStripeAccountLinkType(x string) CreateStripeAccountLinkOption

type CreateStripeAccountLinkOptions added in v0.1.843

type CreateStripeAccountLinkOptions struct {
	A          stripeApi.Account
	ReturnURL  string
	RefreshURL string
	Type       string
}

func ApplyCreateStripeAccountLinkOptions added in v0.1.843

func ApplyCreateStripeAccountLinkOptions(opts *CreateStripeAccountLinkOptions, modifiers ...CreateStripeAccountLinkOption) CreateStripeAccountLinkOptions

func (*CreateStripeAccountLinkOptions) Params added in v0.1.845

func (*CreateStripeAccountLinkOptions) Validate added in v0.1.843

func (o *CreateStripeAccountLinkOptions) Validate() error

type DBOperator added in v0.0.5

type DBOperator interface {
	InsertOne(ctx context.Context, opts InsertOneOptions) error
	FindOne(ctx context.Context, opts FindOneOptions) error
	FindMany(ctx context.Context, opts FindManyOptions) ([]any, error)
	ReplaceOne(ctx context.Context, opts ReplaceOneOptions) error
	DeleteOne(ctx context.Context, opts DeleteOneOptions) error
	DeleteMany(ctx context.Context, opts DeleteManyOptions) error
}

type DateFilterOptions added in v0.0.5

type DateFilterOptions struct {
	YearField  string
	MonthField string
	DayField   string
	RefYear    uint
	RefMonth   uint
	RefDay     uint
	IncludeDay bool
}

type DecodeCallbackOption added in v0.1.798

type DecodeCallbackOption = Opt[DecodeCallbackOptions]

func WithDecodeCallbackRequest added in v0.1.798

func WithDecodeCallbackRequest(x *http.Request) DecodeCallbackOption

type DecodeCallbackOptions added in v0.1.796

type DecodeCallbackOptions struct {
	R *http.Request
}

func ApplyDecodeCallbackOptions added in v0.1.802

func ApplyDecodeCallbackOptions(opts *DecodeCallbackOptions, modifiers ...DecodeCallbackOption) DecodeCallbackOptions

type DecodeCursorOptions added in v0.0.5

type DecodeCursorOptions struct {
	Cursor   MongoCursor
	Receiver any
}

type DecodeStripeEventDataOption added in v0.1.926

type DecodeStripeEventDataOption = Opt[DecodeStripeEventDataOptions]

func WithDecodeStripeEventDataE added in v0.1.926

func WithDecodeStripeEventDataE(x *stripeApi.Event) DecodeStripeEventDataOption

func WithDecodeStripeEventDataV added in v0.1.926

func WithDecodeStripeEventDataV(x any) DecodeStripeEventDataOption

type DecodeStripeEventDataOptions added in v0.1.926

type DecodeStripeEventDataOptions struct {
	E *stripeApi.Event
	V any
}

func ApplyDecodeStripeEventDataOptions added in v0.1.926

func ApplyDecodeStripeEventDataOptions(opts *DecodeStripeEventDataOptions, modifiers ...DecodeStripeEventDataOption) DecodeStripeEventDataOptions

func (*DecodeStripeEventDataOptions) Validate added in v0.1.926

func (o *DecodeStripeEventDataOptions) Validate() error

type DecodeStripeEventOption added in v0.1.843

type DecodeStripeEventOption = Opt[DecodeStripeEventOptions]

func WithDecodeStripeEventR added in v0.1.843

func WithDecodeStripeEventR(x *http.Request) DecodeStripeEventOption

type DecodeStripeEventOptions added in v0.1.843

type DecodeStripeEventOptions struct {
	R *http.Request
}

func ApplyDecodeStripeEventOptions added in v0.1.843

func ApplyDecodeStripeEventOptions(opts *DecodeStripeEventOptions, modifiers ...DecodeStripeEventOption) DecodeStripeEventOptions

func (*DecodeStripeEventOptions) Validate added in v0.1.843

func (o *DecodeStripeEventOptions) Validate() error

type DeleteManyOptions added in v0.0.5

type DeleteManyOptions struct {
	Collection string
	Filter     bson.M
	DeleteAll  bool
}

type DeleteOneHandlerOptions added in v0.1.270

type DeleteOneHandlerOptions struct {
	Atz
	Bypass
}

type DeleteOneOptions added in v0.0.5

type DeleteOneOptions struct {
	Collection string
	IDKey      string
	ID         Identifier
}

type DeleteStripeAccountOption added in v0.1.843

type DeleteStripeAccountOption = Opt[DeleteStripeAccountOptions]

func WithDeleteStripeAccountConnectedAccountID added in v0.1.845

func WithDeleteStripeAccountConnectedAccountID(x *ID) DeleteStripeAccountOption

type DeleteStripeAccountOptions added in v0.1.843

type DeleteStripeAccountOptions struct {
	StripeConnectedAccountID
}

func ApplyDeleteStripeAccountOptions added in v0.1.843

func ApplyDeleteStripeAccountOptions(opts *DeleteStripeAccountOptions, modifiers ...DeleteStripeAccountOption) DeleteStripeAccountOptions

func (*DeleteStripeAccountOptions) Params added in v0.1.845

func (*DeleteStripeAccountOptions) Validate added in v0.1.843

func (o *DeleteStripeAccountOptions) Validate() error

type DeleteStripeBankAccountOption added in v0.1.843

type DeleteStripeBankAccountOption = Opt[DeleteStripeBankAccountOptions]

func WithDeleteStripeBankAccountBankAccountID added in v0.1.843

func WithDeleteStripeBankAccountBankAccountID(x *ID) DeleteStripeBankAccountOption

func WithDeleteStripeBankAccountConnectedAccountID added in v0.1.845

func WithDeleteStripeBankAccountConnectedAccountID(x *ID) DeleteStripeBankAccountOption

type DeleteStripeBankAccountOptions added in v0.1.843

type DeleteStripeBankAccountOptions struct {
	StripeConnectedAccountID
	BankAccountID *ID
}

func ApplyDeleteStripeBankAccountOptions added in v0.1.843

func ApplyDeleteStripeBankAccountOptions(opts *DeleteStripeBankAccountOptions, modifiers ...DeleteStripeBankAccountOption) DeleteStripeBankAccountOptions

func (*DeleteStripeBankAccountOptions) Params added in v0.1.845

func (*DeleteStripeBankAccountOptions) Validate added in v0.1.843

func (o *DeleteStripeBankAccountOptions) Validate() error

type Dt added in v0.1.637

type Dt struct {
	Y   *int64      `json:"y" validate:"nnpt,nz"`
	M   *time.Month `json:"m" validate:"nnpt,monthrange"`
	D   *int64      `json:"d" validate:"nnpt,dayrange"`
	H   *int64      `json:"h" validate:"nnpt,hourrange"`
	Min *int64      `json:"min" validate:"nnpt,minuterange"`
	Tz  *string     `json:"tz" validate:"nnpt,tz"`
}

func NewDt added in v0.1.639

func NewDt(opts ...DtOptions) *Dt

func NewDtExample added in v0.1.826

func NewDtExample() *Dt

NewDtExample returns a deterministic Dt with all fields set to 1.

func NewDtFromTime added in v0.1.637

func NewDtFromTime(t time.Time) *Dt

func (Dt) AddDays added in v0.1.642

func (d Dt) AddDays(ctx context.Context, g Geocoder, days int64) (Dt, error)

func (Dt) AddDuration added in v0.1.642

func (d Dt) AddDuration(ctx context.Context, g Geocoder, dur time.Duration) (Dt, error)

func (Dt) AddMonths added in v0.1.642

func (d Dt) AddMonths(ctx context.Context, g Geocoder, months int64) (Dt, error)

func (Dt) AddWeeks added in v0.1.642

func (d Dt) AddWeeks(ctx context.Context, g Geocoder, weeks int64) (Dt, error)

func (Dt) AddYears added in v0.1.642

func (d Dt) AddYears(ctx context.Context, g Geocoder, years int64) (Dt, error)

func (Dt) After added in v0.1.639

func (d Dt) After(ctx context.Context, g Geocoder, o Dt) (bool, error)

After reports whether d occurs after o.

func (Dt) AsUTC added in v0.1.639

func (d Dt) AsUTC() Dt

AsUTC returns a copy of d with tz set to UTC.

func (Dt) Before added in v0.1.639

func (d Dt) Before(ctx context.Context, g Geocoder, o Dt) (bool, error)

Before reports whether d occurs before o.

func (Dt) Compare added in v0.1.639

func (d Dt) Compare(ctx context.Context, g Geocoder, o Dt) (int, error)

Compare tri-state compares d and o (-1 if d<o, 0 if equal, 1 if d>o).

func (Dt) CompareDay added in v0.1.791

func (d Dt) CompareDay(ctx context.Context, g Geocoder, o Dt) (int, error)

CompareDay compares d and o by day precision (-1 if d<o, 0 if equal, 1 if d>o), using each Dt's own local timezone.

func (Dt) CompareDayIn added in v0.1.794

func (d Dt) CompareDayIn(ctx context.Context, g Geocoder, o Dt, tz string) (int, error)

CompareDayIn compares d and o by day after converting both to the provided IANA tz.

func (Dt) Diff added in v0.1.641

func (d Dt) Diff(ctx context.Context, g Geocoder, o Dt) (time.Duration, error)

Diff returns d - o as a duration (in absolute time), comparing both instants in UTC.

func (*Dt) ForceUTC added in v0.1.639

func (d *Dt) ForceUTC()

ForceUTC sets d.Tz to UTC in place.

func (*Dt) GetD added in v0.1.639

func (d *Dt) GetD() int64

func (*Dt) GetH added in v0.1.639

func (d *Dt) GetH() int64

func (*Dt) GetM added in v0.1.639

func (d *Dt) GetM() time.Month

func (*Dt) GetMin added in v0.1.639

func (d *Dt) GetMin() int64

func (*Dt) GetTz added in v0.1.639

func (d *Dt) GetTz() string

func (*Dt) GetY added in v0.1.639

func (d *Dt) GetY() int64

func (Dt) Midnight added in v0.1.639

func (d Dt) Midnight() Dt

func (Dt) Round added in v0.1.640

func (d Dt) Round(ctx context.Context, g Geocoder, dur time.Duration) (Dt, error)

func (*Dt) SetD added in v0.1.639

func (d *Dt) SetD(x int64)

func (*Dt) SetH added in v0.1.639

func (d *Dt) SetH(x int64)

func (*Dt) SetM added in v0.1.639

func (d *Dt) SetM(x time.Month)

func (*Dt) SetMin added in v0.1.639

func (d *Dt) SetMin(x int64)

func (*Dt) SetTz added in v0.1.639

func (d *Dt) SetTz(x string)

func (*Dt) SetY added in v0.1.639

func (d *Dt) SetY(x int64)

func (Dt) Since added in v0.1.641

func (d Dt) Since(ctx context.Context, g Geocoder, o Dt) (time.Duration, error)

Since returns the duration between d and o as d - o (alias of Diff).

func (Dt) SubDuration added in v0.1.642

func (d Dt) SubDuration(ctx context.Context, g Geocoder, dur time.Duration) (Dt, error)

func (Dt) TimeLocal added in v0.1.639

func (d Dt) TimeLocal(ctx context.Context, g Geocoder) (time.Time, error)

func (Dt) TimeUTC added in v0.1.637

func (d Dt) TimeUTC(ctx context.Context, g Geocoder) (time.Time, error)

func (Dt) Until added in v0.1.641

func (d Dt) Until(ctx context.Context, g Geocoder, o Dt) (time.Duration, error)

Until returns the duration from d to o as o - d.

func (Dt) Weekday added in v0.1.644

func (d Dt) Weekday(ctx context.Context, g Geocoder) (time.Weekday, error)

func (Dt) WithTz added in v0.1.639

func (d Dt) WithTz(x string) Dt

WithTz returns a copy of d with tz set to x (no shifting).

type DtOptions added in v0.1.639

type DtOptions func(*Dt)

func WithDtD added in v0.1.639

func WithDtD(x int64) DtOptions

func WithDtH added in v0.1.639

func WithDtH(x int64) DtOptions

func WithDtM added in v0.1.639

func WithDtM(x time.Month) DtOptions

func WithDtMin added in v0.1.639

func WithDtMin(x int64) DtOptions

func WithDtTz added in v0.1.639

func WithDtTz(x string) DtOptions

func WithDtY added in v0.1.639

func WithDtY(x int64) DtOptions

type ElemMatchFilterOptions added in v0.0.5

type ElemMatchFilterOptions struct {
	ArrayField string
	Element    any
	PrependStr string
	AppendStr  string
}

type ElemsInArrayFilterOptions added in v0.0.5

type ElemsInArrayFilterOptions struct {
	ArrayField string
	Elements   []any
	PrependStr string
	AppendStr  string
}

type EmailByter added in v0.1.381

type EmailByter interface {
	Bytes(ctx context.Context, e *email.Email) ([]byte, error)
}

type EmailOperator added in v0.1.381

type EmailOperator interface {
	EmailPubSub
	EmailSender
}

type EmailPubSub added in v0.1.381

type EmailPubSub interface {
	NewPubSubEmail(ctx context.Context, t EmailTemplateType, targetLanguage, recipientEmail, recipientUsername string, s EmailSpecifics) (*pubsub.Message, error)
	EncodeSpecifics(ctx context.Context, s EmailSpecifics) (string, error)
	GetSuspensionSentence(ctx context.Context, enumVal int) (EmailSuspensionReason, error)
}

type EmailSender added in v0.1.381

type EmailSender interface {
	SendEmail(ctx context.Context, opts SendEmailOptions) error
}

type EmailSenderInfo added in v0.1.394

type EmailSenderInfo struct {
	Name        string
	FromAddress string
	UserID      string
	ReplyTo     string
}

type EmailSpecifics added in v0.1.396

type EmailSpecifics map[string]string

type EmailSuspensionReason added in v0.1.396

type EmailSuspensionReason = string

type EmailTemplateType added in v0.1.396

type EmailTemplateType = string

type Emailable added in v0.1.385

type Emailable interface {
	Init(ctx context.Context, opts InitOptions) error
	GetSubject() string
	GetTemplateType() EmailTemplateType
}

type EmbedC added in v0.1.671

type EmbedC struct {
	Text    *string `json:"text" validate:"nnpt"`
	File    *[]byte `json:"file" validate:"nnpt"`
	FileURL *string `json:"file_url" validate:"nnpt"`
	MIME    *string `json:"mime" validate:"nnpt"`
}

func NewEmbedC added in v0.1.671

func NewEmbedC(opts ...EmbedCOption) *EmbedC

func (*EmbedC) GetFile added in v0.1.671

func (c *EmbedC) GetFile() []byte

func (*EmbedC) GetFileURL added in v0.1.671

func (c *EmbedC) GetFileURL() string

func (*EmbedC) GetMIME added in v0.1.671

func (c *EmbedC) GetMIME() string

func (*EmbedC) GetText added in v0.1.671

func (c *EmbedC) GetText() string

func (EmbedC) IsZero added in v0.1.671

func (c EmbedC) IsZero() bool

func (*EmbedC) SetFile added in v0.1.671

func (c *EmbedC) SetFile(x []byte)

func (*EmbedC) SetFileURL added in v0.1.671

func (c *EmbedC) SetFileURL(x string)

func (*EmbedC) SetMIME added in v0.1.671

func (c *EmbedC) SetMIME(x string)

func (*EmbedC) SetText added in v0.1.671

func (c *EmbedC) SetText(x string)

func (EmbedC) Validate added in v0.1.671

func (c EmbedC) Validate() error

type EmbedCOption added in v0.1.796

type EmbedCOption = Opt[EmbedC]

func WithEmbedCFile added in v0.1.671

func WithEmbedCFile(x []byte) EmbedCOption

func WithEmbedCFileURL added in v0.1.671

func WithEmbedCFileURL(x string) EmbedCOption

func WithEmbedCMIME added in v0.1.671

func WithEmbedCMIME(x string) EmbedCOption

func WithEmbedCText added in v0.1.671

func WithEmbedCText(x string) EmbedCOption

type EmbedInput added in v0.1.668

type EmbedInput struct {
	EmbedC
	Modality *Modality
}

func NewEmbedInputFile added in v0.1.668

func NewEmbedInputFile(b []byte, mime string, m Modality) EmbedInput

func NewEmbedInputFileURL added in v0.1.668

func NewEmbedInputFileURL(u string, mime string, m Modality) EmbedInput

func NewEmbedInputText added in v0.1.668

func NewEmbedInputText(s string) EmbedInput

func (EmbedInput) IsZero added in v0.1.668

func (e EmbedInput) IsZero() bool

func (EmbedInput) Validate added in v0.1.668

func (e EmbedInput) Validate() error

type EmbedR added in v0.1.672

type EmbedR struct {
	V                *[][]float32 `bson:"-" json:"-"`
	EmbeddingVersion *string      `json:"embedding_version" validate:"nnpt"`
	Dim              *int         `json:"dim" validate:"nnpt"`
	Modality         *Modality    `json:"modality" validate:"nnpt"`
}

func NewEmbedR added in v0.1.672

func NewEmbedR(opts ...EmbedROption) *EmbedR

func (*EmbedR) GetDim added in v0.1.672

func (e *EmbedR) GetDim() int

func (*EmbedR) GetEmbeddingVersion added in v0.1.672

func (e *EmbedR) GetEmbeddingVersion() string

func (*EmbedR) GetModality added in v0.1.672

func (e *EmbedR) GetModality() Modality

func (*EmbedR) GetV added in v0.1.672

func (e *EmbedR) GetV() [][]float32

func (*EmbedR) IsZero added in v0.1.743

func (e *EmbedR) IsZero() bool

func (*EmbedR) SetDim added in v0.1.672

func (e *EmbedR) SetDim(x int)

func (*EmbedR) SetEmbeddingVersion added in v0.1.672

func (e *EmbedR) SetEmbeddingVersion(x string)

func (*EmbedR) SetModality added in v0.1.672

func (e *EmbedR) SetModality(x Modality)

func (*EmbedR) SetV added in v0.1.672

func (e *EmbedR) SetV(x [][]float32)

func (*EmbedR) Validate added in v0.1.672

func (e *EmbedR) Validate(expectN int) error

type EmbedROption added in v0.1.672

type EmbedROption = Opt[EmbedR]

func WithDim added in v0.1.672

func WithDim(x int) EmbedROption

func WithEmbedRV added in v0.1.672

func WithEmbedRV(x [][]float32) EmbedROption

func WithEmbeddingVersion added in v0.1.672

func WithEmbeddingVersion(x string) EmbedROption

func WithModality added in v0.1.672

func WithModality(x Modality) EmbedROption

type EmbedderOperator added in v0.1.661

type EmbedderOperator interface {
	GetTextEmbeddings(ctx context.Context, docs []string) (*EmbedR, error)
	GetImageEmbeddings(ctx context.Context, imgs []MediaInput) (*EmbedR, error)
	GetVideoEmbeddings(ctx context.Context, vids []MediaInput) (*EmbedR, error)
}

type EmbeddingIndexOptions added in v0.1.674

type EmbeddingIndexOptions struct {
	Field       string
	Additionals []string
}

type EmbeddingOptions added in v0.1.665

type EmbeddingOptions struct {
	I             EmbeddingIndexOptions
	Model         string
	TaskType      string
	NumDimensions int
	Quantization  string
	Similarity    string
	Modality      Modality
}

func DefaultImageEmbeddingOptions added in v0.1.668

func DefaultImageEmbeddingOptions(opts EmbeddingIndexOptions) EmbeddingOptions

func DefaultTextEmbeddingOptions added in v0.1.668

func DefaultTextEmbeddingOptions(opts EmbeddingIndexOptions) EmbeddingOptions

func DefaultVideoEmbeddingOptions added in v0.1.668

func DefaultVideoEmbeddingOptions(opts EmbeddingIndexOptions) EmbeddingOptions

func (*EmbeddingOptions) Validate added in v0.1.665

func (o *EmbeddingOptions) Validate() error

type EnsureBucketOption added in v0.1.479

type EnsureBucketOption = Opt[EnsureBucketOptions]

func WithEnsureBucketAttrs added in v0.1.479

func WithEnsureBucketAttrs(x storage.BucketAttrs) EnsureBucketOption

func WithEnsureBucketName added in v0.1.479

func WithEnsureBucketName(x string) EnsureBucketOption

type EnsureBucketOptions added in v0.1.479

type EnsureBucketOptions struct {
	Name string
	A    storage.BucketAttrs
}

func ApplyEnsureBucketOptions added in v0.1.479

func ApplyEnsureBucketOptions(opts *EnsureBucketOptions, modifiers ...EnsureBucketOption) EnsureBucketOptions

type Entry added in v0.1.10

type Entry struct {
	Handler HandlerFunc
	Weight  uint
}

Entry maps an HTTP handler to a request weight.

type Env added in v0.1.80

type Env string
const (
	Noop    Env = "noop"
	NoStore Env = "nostore"
	Dev     Env = "dev"
	Staging Env = "staging"
	Prod    Env = "prod"
)

func (Env) Validate added in v0.1.126

func (e Env) Validate() error

type EnvInfo added in v0.1.105

type EnvInfo struct {
	E            Env
	L            Level
	Project      string
	Addr         string
	MongoConnStr string
	MongoCluster string
	RedisHost    string
	RedisPort    int
}

func ExtractEnvInfo added in v0.1.106

func ExtractEnvInfo() (*EnvInfo, error)

ExtractEnvInfo returns the current environment information.

type EnvironmentOperator added in v0.1.105

type EnvironmentOperator interface {
	Info(ctx context.Context) (EnvInfo, error)
	RewriteHost(ctx context.Context, u *url.URL) error
	Resolve(ctx context.Context, t, p any) (any, error)
}

type FQDN added in v0.1.603

type FQDN string

FQDN explicitly marks a fully-qualified domain name.

func (FQDN) String added in v0.1.603

func (f FQDN) String() string

type FSysFileReader

type FSysFileReader interface {
	FSysReadFile(ctx context.Context, fsys fs.ReadFileFS, path string) ([]byte, error)
}

type FSysOperator added in v0.1.377

type FSysOperator interface {
	FSysFileReader
	FSysSubFSOperator
	FSysReadDirOperator
}

type FSysReadDirOperator added in v0.1.516

type FSysReadDirOperator interface {
	FSysReadDir(ctx context.Context, fsys fs.FS, path string) ([]fs.DirEntry, error)
}

type FSysSubFSOperator added in v0.1.377

type FSysSubFSOperator interface {
	FSysSub(ctx context.Context, fsys fs.FS, path string) (fs.FS, error)
}

type FactoryOperator added in v0.1.10

type FactoryOperator interface {
	PullFactoryOperator
	New(ctx context.Context, name string) (any, error)
	NewDefault(ctx context.Context, name string) (any, error)
}

type FeedReactionType added in v0.1.747

type FeedReactionType int64
const (
	FeedReport FeedReactionType = iota
	FeedDislike
	FeedLike
)

func (*FeedReactionType) Score added in v0.1.763

func (o *FeedReactionType) Score() int

func (*FeedReactionType) Validate added in v0.1.747

func (o *FeedReactionType) Validate() error

type FetchManyOption added in v0.1.416

type FetchManyOption = Opt[FetchManyOptions]

func WithFetchManyCollection added in v0.1.416

func WithFetchManyCollection(x string) FetchManyOption

func WithFetchManyMock added in v0.1.417

func WithFetchManyMock(x any) FetchManyOption

func WithFetchManyQuery added in v0.1.416

func WithFetchManyQuery(x map[string][]string) FetchManyOption

func WithFetchManyReceiver added in v0.1.416

func WithFetchManyReceiver(x any) FetchManyOption

func WithFetchManyRequest added in v0.1.416

func WithFetchManyRequest(x *http.Request) FetchManyOption

func WithFetchManyService added in v0.1.416

func WithFetchManyService(x string) FetchManyOption

type FetchManyOptions added in v0.1.416

type FetchManyOptions struct {
	C
	Q map[string][]string
}

func ApplyFetchManyOptions added in v0.1.416

func ApplyFetchManyOptions(opts *FetchManyOptions, modifiers ...FetchManyOption) FetchManyOptions

func (*FetchManyOptions) Validate added in v0.1.416

func (o *FetchManyOptions) Validate() error

type FetchOneOption added in v0.1.416

type FetchOneOption = Opt[FetchOneOptions]

func WithFetchOneCollection added in v0.1.416

func WithFetchOneCollection(x string) FetchOneOption

func WithFetchOneID added in v0.1.416

func WithFetchOneID(x fmt.Stringer) FetchOneOption

func WithFetchOneMock added in v0.1.417

func WithFetchOneMock(x any) FetchOneOption

func WithFetchOneReceiver added in v0.1.416

func WithFetchOneReceiver(x any) FetchOneOption

func WithFetchOneRequest added in v0.1.416

func WithFetchOneRequest(x *http.Request) FetchOneOption

func WithFetchOneService added in v0.1.416

func WithFetchOneService(x string) FetchOneOption

type FetchOneOptions added in v0.1.416

type FetchOneOptions struct {
	C
	ID fmt.Stringer
}

func ApplyFetchOneOptions added in v0.1.416

func ApplyFetchOneOptions(opts *FetchOneOptions, modifiers ...FetchOneOption) FetchOneOptions

func (*FetchOneOptions) Validate added in v0.1.416

func (o *FetchOneOptions) Validate() error

type FetcherOperator added in v0.1.416

type FetcherOperator interface {
	FetchOne(ctx context.Context, opts FetchOneOptions) (any, error)
	FetchMany(ctx context.Context, opts FetchManyOptions) ([]any, error)
}

type FieldInArrayFilterOptions added in v0.0.5

type FieldInArrayFilterOptions struct {
	Field    string
	Elements []any
}

type FilterOptions added in v0.0.5

type FilterOptions struct {
	ConvertValues  bool
	QueryParams    map[string][]string
	MatchBehavior  MatchBehavior
	PrependStr     string
	AppendStr      string
	ExcludedFields []string
}

type FindManyHandlerOptions added in v0.1.270

type FindManyHandlerOptions struct {
	Atz
	Bypass
	Filter        bson.M
	SortDirection SortDirection
	Skip          int64
	Limit         int64
	ValidateQuery bool
	InjectQuery   map[string][]string
}

type FindManyOptions added in v0.0.5

type FindManyOptions struct {
	FindManyHandlerOptions
	Collection string
	Receiver   any
	SortByKey  string
}

type FindObjectsOption added in v0.1.479

type FindObjectsOption = Opt[FindObjectsOptions]

func WithFindObjectsBucketName added in v0.1.479

func WithFindObjectsBucketName(x string) FindObjectsOption

func WithFindObjectsQuery added in v0.1.479

func WithFindObjectsQuery(x *storage.Query) FindObjectsOption

type FindObjectsOptions added in v0.1.479

type FindObjectsOptions struct {
	BucketName string
	Q          *storage.Query
}

func ApplyFindObjectsOptions added in v0.1.479

func ApplyFindObjectsOptions(opts *FindObjectsOptions, modifiers ...FindObjectsOption) FindObjectsOptions

func (*FindObjectsOptions) Validate added in v0.1.479

func (o *FindObjectsOptions) Validate() error

type FindOneHandlerOptions added in v0.1.360

type FindOneHandlerOptions struct {
	Bypass
}

type FindOneOptions added in v0.0.5

type FindOneOptions struct {
	Collection string
	Receiver   any
	IDKey      string
	ID         Identifier
}

type FirebaseAuthenticator added in v0.1.178

type FirebaseAuthenticator interface {
	AuthenticateFirebaseIDToken(ctx context.Context, r *http.Request, opts AuthOptions) error
}

type FirebaseInitializer added in v0.1.583

type FirebaseInitializer interface {
	InitFirebase(ctx context.Context, credentialsJSON []byte) (*firebase.App, error)
}

type FirebaseMockUser added in v0.1.220

type FirebaseMockUser struct {
	Email    string
	Password string
}

type FirebaseOperator added in v0.1.10

type FirebaseTester added in v0.1.219

type FirebaseTester interface {
	DeleteMockUser(ctx context.Context, email string) error
	CreateMockUser(ctx context.Context) (*FirebaseMockUser, error)
}

type FirebaseUtil added in v0.1.178

type FirebaseUtil interface {
	FirebaseIDToken(ctx context.Context, u FirebaseMockUser, apiKey string) (string, error)
	GenerateMockFirebaseUID(ctx context.Context, length int) (string, error)
	GetAPIKey(ctx context.Context) (string, error)
}

type GenerateSignedObjectURLsOption added in v0.1.479

type GenerateSignedObjectURLsOption = Opt[GenerateSignedObjectURLsOptions]

func WithGenerateSignedObjectURLsAttrs added in v0.1.479

func WithGenerateSignedObjectURLsAttrs(x []*storage.ObjectAttrs) GenerateSignedObjectURLsOption

func WithGenerateSignedObjectURLsBucketName added in v0.1.479

func WithGenerateSignedObjectURLsBucketName(x string) GenerateSignedObjectURLsOption

func WithGenerateSignedObjectURLsOpts added in v0.1.479

func WithGenerateSignedObjectURLsOpts(x *storage.SignedURLOptions) GenerateSignedObjectURLsOption

type GenerateSignedObjectURLsOptions added in v0.1.479

type GenerateSignedObjectURLsOptions struct {
	BucketName string
	Attrs      []*storage.ObjectAttrs
	Opts       *storage.SignedURLOptions
}

func ApplyGenerateSignedObjectURLsOptions added in v0.1.479

func ApplyGenerateSignedObjectURLsOptions(opts *GenerateSignedObjectURLsOptions, modifiers ...GenerateSignedObjectURLsOption) GenerateSignedObjectURLsOptions

func (*GenerateSignedObjectURLsOptions) Validate added in v0.1.479

func (o *GenerateSignedObjectURLsOptions) Validate() error

type GenerateUsernameOption added in v0.1.426

type GenerateUsernameOption = Opt[GenerateUsernameOptions]

func WithBaseDigit added in v0.1.426

func WithBaseDigit(x int) GenerateUsernameOption

func WithLenUsernameMax added in v0.1.431

func WithLenUsernameMax(x int) GenerateUsernameOption

func WithLenUsernameMin added in v0.1.431

func WithLenUsernameMin(x int) GenerateUsernameOption

func WithMaxPerWord added in v0.1.456

func WithMaxPerWord(x int) GenerateUsernameOption

func WithWords added in v0.1.456

func WithWords(x []string) GenerateUsernameOption

type GenerateUsernameOptions added in v0.1.426

type GenerateUsernameOptions struct {
	LenUsernameMin int
	LenUsernameMax int
	BaseDigit      int
	MaxPerWord     int
	Words          []string
}

func ApplyGenerateUsernameOptions added in v0.1.426

func ApplyGenerateUsernameOptions(opts *GenerateUsernameOptions, modifiers ...GenerateUsernameOption) GenerateUsernameOptions

func (GenerateUsernameOptions) Validate added in v0.1.457

func (o GenerateUsernameOptions) Validate() error

type Generator added in v0.1.426

type Generator interface {
	GenerateUsername(ctx context.Context, opts GenerateUsernameOptions) (string, error)
	ReverseString(ctx context.Context, s string) (string, error)
}

type Geocoder

type Geocoder interface {
	TimezoneFromCoordinates(ctx context.Context, latitude, longitude float64) (string, error)
	CityFromCoordinates(ctx context.Context, latitude, longitude float64) (string, error)
	TimezoneDataFromCoordinates(ctx context.Context, latitude, longitude float64) (*maps.TimezoneResult, error)
	GeocodeCoordinates(ctx context.Context, latitude, longitude float64) ([]maps.GeocodingResult, error)
	SwapTimezone(ctx context.Context, t time.Time, tz string, toUTC, toMidnight bool) (time.Time, error)
	LoadLocation(ctx context.Context, l string) (*time.Location, error)
	IsUTC(ctx context.Context, t time.Time) (bool, error)
}

type GmailMessager added in v0.1.381

type GmailMessager interface {
	Message(u *gmail.UsersMessagesSendCall, opts ...googleapi.CallOption) (*gmail.Message, error)
}

type GmailService added in v0.1.381

type GmailService any

type GmailUsersMessageService added in v0.1.381

type GmailUsersMessageService interface {
	Send(userID string, message *gmail.Message) *gmail.UsersMessagesSendCall
}

type GoogleMaps added in v0.0.5

type GoogleMaps interface {
	Timezone(ctx context.Context, r *maps.TimezoneRequest) (*maps.TimezoneResult, error)
	Geocode(ctx context.Context, r *maps.GeocodingRequest) ([]maps.GeocodingResult, error)
}

type GoogleRouteOptimization added in v0.1.780

type GoogleRouteOptimization interface {
	Closer
	OptimizeTours(ctx context.Context, req *routeoptimizationpb.OptimizeToursRequest, opts ...gax.CallOption) (*routeoptimizationpb.OptimizeToursResponse, error)
}

type GoogleStorage added in v0.1.479

type GoogleStorage interface {
	Bucket(name string) *storage.BucketHandle
	Close() error
}

type GoogleVideoIntelligence added in v0.1.477

type GoogleVideoIntelligence interface {
	AnnotateVideo(ctx context.Context, req *videointelligencepb.AnnotateVideoRequest, opts ...gax.CallOption) (*videointelligence.AnnotateVideoOperation, error)
	Close() error
}

type GoogleVision added in v0.1.478

type GoogleVision interface {
	BatchAnnotateImages(ctx context.Context, req *visionpb.BatchAnnotateImagesRequest, opts ...gax.CallOption) (*visionpb.BatchAnnotateImagesResponse, error)
	Close() error
}

type GrokOperator added in v0.1.702

type GrokOperator interface{ GrokPrompter }

type GrokPrompter added in v0.1.702

type GrokPrompter interface {
	PrompterOperator
}

type GrokRequest added in v0.1.702

type GrokRequest struct {
	Model       string                `json:"model"`
	M           []PromptMessage       `json:"messages"`
	Stream      bool                  `json:"stream,omitempty"`
	Temperature float64               `json:"temperature,omitempty"`
	R           *PromptResponseFormat `json:"response_format,omitempty"`
}

type GrokResponse added in v0.1.702

type GrokResponse struct {
	ID      string `json:"id"`
	Object  string `json:"object"`
	Created int    `json:"created"`
	Model   string `json:"model"`
	Choices []struct {
		Index   int `json:"index"`
		Message struct {
			Role    string `json:"role"`
			Content string `json:"content"`
			Refusal string `json:"refusal,omitempty"`
		} `json:"message"`
		FinishReason string `json:"finish_reason"`
	} `json:"choices"`
	Usage struct {
		PromptTokens        int `json:"prompt_tokens"`
		CompletionTokens    int `json:"completion_tokens"`
		TotalTokens         int `json:"total_tokens"`
		PromptTokensDetails struct {
			TextTokens   int `json:"text_tokens"`
			AudioTokens  int `json:"audio_tokens"`
			ImageTokens  int `json:"image_tokens"`
			CachedTokens int `json:"cached_tokens"`
		} `json:"prompt_tokens_details"`
	} `json:"usage"`
	SystemFingerprint string `json:"system_fingerprint"`
}

type Guard added in v0.1.830

type Guard[T any] struct {
	G    func() T
	S    func(T)
	Cond func(T) bool
	Fix  T
}

Guard runs Cond on G() and, if true, calls S(Fix).

func NewGuard added in v0.1.832

func NewGuard[T any](g func() T, s func(T), cond func(T) bool, fix T) Guard[T]

func NewNegativeGuard added in v0.1.830

func NewNegativeGuard[T Signed](g func() T, s func(T)) Guard[T]

NewNegativeGuard builds a Guard that zeroes negative values.

func (Guard[T]) Apply added in v0.1.830

func (g Guard[T]) Apply()

type GuardRunner added in v0.1.830

type GuardRunner interface{ Apply() }

type GzipReader

type GzipReader interface {
	Read(ctx context.Context, r io.Reader) (io.Reader, error)
}

type GzipUtil

type GzipUtil interface {
	WriteGzip(ctx context.Context, w *gzip.Writer, r io.Reader) error
	CloseGzipWriter(ctx context.Context, w *gzip.Writer) error
	ReadGzip(ctx context.Context, r io.Reader) ([]byte, error)
	NewGzipReader(ctx context.Context, r io.Reader) (*gzip.Reader, error)
	CopyToBuffer(ctx context.Context, r *gzip.Reader, buf *bytes.Buffer) error
	CloseGzipReader(ctx context.Context, r *gzip.Reader) error
}

type GzipWriter

type GzipWriter interface {
	Write(ctx context.Context, r io.Reader) (io.Reader, int64, error)
}

type HTTPClient added in v0.0.5

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type HTTPDoer

type HTTPDoer interface {
	Do(ctx context.Context, r *http.Request) (*http.Response, error)
	DoWithTimeout(ctx context.Context, r *http.Request, t time.Duration) (*http.Response, error)
}

type HTTPFileOpener added in v0.1.377

type HTTPFileOpener interface {
	OpenFile(ctx context.Context, fsys http.FileSystem, name string) (http.File, error)
}

type HTTPFormParser added in v0.1.796

type HTTPFormParser interface {
	ParseForm(ctx context.Context, r *http.Request) error
}

type HTTPHTML added in v0.1.5

type HTTPHTML interface {
	ServeHTML(ctx context.Context, w http.ResponseWriter, body io.Reader, status int) error
}

type HTTPOperator added in v0.1.377

type HTTPOperator interface {
	HTTPResponder
	HTTPUtil
	HTTPHTML
	HTTPDoer
}

type HTTPRequester

type HTTPRequester interface {
	NewRequest(ctx context.Context, method, url string, opts RequestOptions) (*http.Request, error)
}

type HTTPResponder added in v0.1.5

type HTTPResponder interface {
	RespondJSON(ctx context.Context, w http.ResponseWriter, v any, status int, escapeHTML bool) error
}

type HTTPResponseWriter added in v0.1.14

type HTTPResponseWriter interface {
	Header() http.Header
	Write([]byte) (int, error)
	WriteHeader(statusCode int)
}

type HTTPServer added in v0.1.10

type HTTPServer interface {
	ListenAndServe() error
	ListenAndServeTLS(certFile string, keyFile string) error
	Shutdown(ctx context.Context) error
}

type HTTPUtil added in v0.1.5

type HTTPUtil interface {
	QueryString(ctx context.Context, pairs ...string) (string, error)
	ValidateQueryParams(ctx context.Context, q map[string][]string, rules ...QueryParamRule) error
	CopyHeaders(ctx context.Context, dst, src *http.Request, headers ...string) error
	GetHeaders(ctx context.Context, r *http.Request) (http.Header, error)
	DecodeBody(ctx context.Context, r *http.Request, v any) error
	SetQueryParams(ctx context.Context, r *http.Request, q map[string][]string, override bool) error
	ServeFile(ctx context.Context, opts ServeFileOptions) error
}

type HTTPWriter

type HTTPWriter interface {
	Write(ctx context.Context, w http.ResponseWriter, b []byte) (int, error)
}

type HandlerFunc added in v0.1.11

type HandlerFunc func(w http.ResponseWriter, r *http.Request) error

HandlerFunc defines a handler function.

func (HandlerFunc) Wrap added in v0.1.11

type ID added in v0.0.8

type ID struct {
	V *string `json:"id" validate:"nnpt"`
}

ID is a custom type for database-agnostic unique IDs.

func NewID added in v0.0.8

func NewID() *ID

func NewIDFromQVals added in v0.1.61

func NewIDFromQVals(q config.QVals) *ID

func NewIDFromString added in v0.0.8

func NewIDFromString(v string) *ID

func NewIDsFromStrings added in v0.1.781

func NewIDsFromStrings(vs []string) []*ID

func NewZeroID added in v0.1.748

func NewZeroID() *ID

func (ID) Equal added in v0.1.628

func (id ID) Equal(other Identifier) bool

func (*ID) GetV added in v0.0.8

func (id *ID) GetV() string

func (*ID) IsEmpty added in v0.0.8

func (id *ID) IsEmpty() bool

func (*ID) MarshalJSON added in v0.1.40

func (id *ID) MarshalJSON() ([]byte, error)

func (*ID) SetV added in v0.0.8

func (id *ID) SetV(x string)

func (ID) String added in v0.0.8

func (id ID) String() string

func (*ID) UnmarshalJSON added in v0.1.40

func (id *ID) UnmarshalJSON(data []byte) error

type IDDecoder added in v0.1.317

type IDDecoder struct{}

func (IDDecoder) DecodeValue added in v0.1.317

func (IDDecoder) DecodeValue(_ bson.DecodeContext, vr bson.ValueReader, val reflect.Value) error

type IDEncoder added in v0.1.317

type IDEncoder struct{}

func (IDEncoder) EncodeValue added in v0.1.317

func (IDEncoder) EncodeValue(_ bson.EncodeContext, vw bson.ValueWriter, val reflect.Value) error

type Identifiable added in v0.0.5

type Identifiable interface {
	GetID() ID
	GetCreatedAt() time.Time
}

type Identifier added in v0.0.5

type Identifier interface {
	GetV() string
	SetV(string)
	IsEmpty() bool
	Equal(Identifier) bool
	fmt.Stringer
	json.Marshaler
	json.Unmarshaler
}

type ImageIntelOperator added in v0.1.478

type ImageIntelOperator interface {
	IntelOperator
}

type IndexEntry added in v0.0.5

type IndexEntry struct {
	Name               *string
	Field              string
	SortDirection      SortDirection
	ExpireAfterSeconds *int32
}

type Indexable added in v0.1.211

type Indexable interface {
	Idx(collection string) CreateIndexesOptions
	IdxSrch(collection string) CreateSearchIndexesOptions
}

type InitOption added in v0.1.385

type InitOption = Opt[InitOptions]

func WithInitUnmarshaler added in v0.1.392

func WithInitUnmarshaler(x Unmarshaler) InitOption

func WithRecipientEmail added in v0.1.385

func WithRecipientEmail(x string) InitOption

func WithRecipientUsername added in v0.1.385

func WithRecipientUsername(x string) InitOption

func WithSpecifics added in v0.1.385

func WithSpecifics(x string) InitOption

func WithSupportRedirectURL added in v0.1.390

func WithSupportRedirectURL(x string) InitOption

func WithTargetLanguage added in v0.1.385

func WithTargetLanguage(x string) InitOption

type InitOptions added in v0.1.385

type InitOptions struct {
	U                  Unmarshaler
	TargetLanguage     string
	RecipientEmail     string
	RecipientUsername  string
	SupportRedirectURL string
	Specifics          string
}

func ApplyInitOptions added in v0.1.385

func ApplyInitOptions(opts *InitOptions, modifiers ...InitOption) InitOptions

type InsertOneHandlerOptions added in v0.1.270

type InsertOneHandlerOptions struct {
	Atz
	Bypass
}

type InsertOneOptions added in v0.0.5

type InsertOneOptions struct {
	Collection string
	Document   Identifiable
}

type IntelOperator added in v0.1.478

type IntelOperator interface {
	IsForbidden(ctx context.Context, r io.Reader) (bool, error)
	ScanMany(ctx context.Context, files []*BucketFile) ([]*BucketScan, error)
	CloserWithCtx
}

type JSONOption

type JSONOption = Opt[JSONOptions]

func WithJSONEscapeHTML

func WithJSONEscapeHTML(escape bool) JSONOption

func WithJSONIndent

func WithJSONIndent(indent string) JSONOption

func WithJSONUseNumber

func WithJSONUseNumber(use bool) JSONOption

type JSONOptions

type JSONOptions struct {
	Indent     string // Enables indentation if non-empty.
	EscapeHTML bool   // Determines if HTML characters should be escaped.
	UseNumber  bool   // If true, decodes numbers as `json.Number` instead of `float64`.
}

JSONOptions defines settings for encoding/decoding.

func ApplyJSONOptions

func ApplyJSONOptions(opts *JSONOptions, modifiers ...JSONOption) JSONOptions

type Level

type Level = slog.Level
const (
	Debug Level = slog.LevelDebug
	Info  Level = slog.LevelInfo
	Warn  Level = slog.LevelWarn
	Error Level = slog.LevelError
	Sep         = "__________"
)

type LibraryOperator added in v0.1.45

type LibraryOperator interface {
	Svc(context.Context) (string, error)
	HeaderKeyUserID(context.Context) (string, error)
}

type LimiterInfo added in v0.1.11

type LimiterInfo interface {
	GetMaxScore(ctx context.Context) (uint, error)
	GetHeaderKey(ctx context.Context) (string, error)
	GetRateLimitingMode(ctx context.Context) (string, error)
}

type LimiterOperator added in v0.1.10

type LimiterOperator interface {
	Engage(next HandlerFunc) HandlerFunc
	LimiterInfo
}

type LinkStripeBankAccountOption added in v0.1.843

type LinkStripeBankAccountOption = Opt[LinkStripeBankAccountOptions]

func WithLinkStripeBankAccountAccountHolderName added in v0.1.843

func WithLinkStripeBankAccountAccountHolderName(x string) LinkStripeBankAccountOption

func WithLinkStripeBankAccountAccountHolderType added in v0.1.843

func WithLinkStripeBankAccountAccountHolderType(x string) LinkStripeBankAccountOption

func WithLinkStripeBankAccountAccountNumber added in v0.1.843

func WithLinkStripeBankAccountAccountNumber(x string) LinkStripeBankAccountOption

func WithLinkStripeBankAccountConnectedAccountID added in v0.1.845

func WithLinkStripeBankAccountConnectedAccountID(x *ID) LinkStripeBankAccountOption

func WithLinkStripeBankAccountCountry added in v0.1.844

func WithLinkStripeBankAccountCountry(x string) LinkStripeBankAccountOption

func WithLinkStripeBankAccountCurrency added in v0.1.844

func WithLinkStripeBankAccountCurrency(x string) LinkStripeBankAccountOption

func WithLinkStripeBankAccountMetadata added in v0.1.843

func WithLinkStripeBankAccountMetadata(x map[string]string) LinkStripeBankAccountOption

func WithLinkStripeBankAccountRoutingNumber added in v0.1.843

func WithLinkStripeBankAccountRoutingNumber(x string) LinkStripeBankAccountOption

type LinkStripeBankAccountOptions added in v0.1.843

type LinkStripeBankAccountOptions struct {
	StripeConnectedAccountID
	AccountHolderName string
	AccountHolderType string
	AccountNumber     string
	RoutingNumber     string
	Country           string
	Currency          string
	Metadata          map[string]string
}

func ApplyLinkStripeBankAccountOptions added in v0.1.843

func ApplyLinkStripeBankAccountOptions(opts *LinkStripeBankAccountOptions, modifiers ...LinkStripeBankAccountOption) LinkStripeBankAccountOptions

func (*LinkStripeBankAccountOptions) Params added in v0.1.845

func (*LinkStripeBankAccountOptions) Validate added in v0.1.843

func (o *LinkStripeBankAccountOptions) Validate() error

type LogOperator added in v0.1.10

type LogOperator interface {
	Log(ctx context.Context, l Level, v any, prefix string, msg ...string)
	Wrap(ctx context.Context, fn func() (any, error)) error
	WrapHandler(h HandlerFunc) HandlerFunc
	WrapMiddleware(m MiddlewareFunc) MiddlewareFunc
}

type MajorUnit added in v0.1.10

type MajorUnit = float64

type Marshaler

type Marshaler interface {
	Marshal(ctx context.Context, v any, opts JSONOptions) ([]byte, error)
}

type MatchBehavior added in v0.0.5

type MatchBehavior = string

MatchBehavior defines different matching behaviors in MongoDB queries, such as in, all, and eq.

type MediaInput added in v0.1.756

type MediaInput struct {
	Bytes *[]byte
	URL   *string
	MIME  string
}

func NewEmbedderMediaBytes added in v0.1.668

func NewEmbedderMediaBytes(b []byte, mime string) MediaInput

func NewEmbedderMediaURL added in v0.1.668

func NewEmbedderMediaURL(u string, mime string) MediaInput

func (MediaInput) IsZero added in v0.1.756

func (e MediaInput) IsZero() bool

func (MediaInput) Validate added in v0.1.756

func (e MediaInput) Validate() error

Validate enforces that one (and only one) source is present and if Bytes is used, MIME must be non-empty.

type MediaOperator added in v0.1.498

type MediaOperator interface {
	CompressImage(ctx context.Context, opts CompressImageOptions) error
	CompressVideo(ctx context.Context, opts CompressVideoOptions) error
	CompressAudio(ctx context.Context, opts CompressAudioOptions) error
}

type MessageRole added in v0.1.245

type MessageRole = string

MessageRole represents the role of a message.

const (
	GrokDefaultModel = "grok-4-fast-reasoning"
	// MessageRoleSystem is the role for the system message.
	MessageRoleSystem MessageRole = "system"
	// MessageRoleUser is the role for the user message.
	MessageRoleUser MessageRole = "user"
	// MessageRoleAssistant is the role for the assistant message.
	MessageRoleAssistant MessageRole = "assistant"
	// GrokChatCompletionURL is the URL for the Grok LLM API.
	GrokChatCompletionURL = "https://api.x.ai/v1/chat/completions"
)

type MiddlewareFunc added in v0.1.10

type MiddlewareFunc func(HandlerFunc) HandlerFunc

MiddlewareFunc defines a composable middleware around a HandlerFunc.

type MiddlewareOperator added in v0.1.10

type MiddlewareOperator interface {
	Chain(fns ...MiddlewareFunc) MiddlewareFunc
	Gzip(next HandlerFunc) HandlerFunc
	EnforceHTTPS(next HandlerFunc) HandlerFunc
	CheckHeaders(next HandlerFunc) HandlerFunc
	CleanURLPath(next HandlerFunc) HandlerFunc
	IdempotentPOST(next HandlerFunc) HandlerFunc
	RequireReader(next HandlerFunc) HandlerFunc
	RequireWriter(next HandlerFunc) HandlerFunc
	RequireOwner(next HandlerFunc) HandlerFunc
	AuthenticateFirebaseIDToken(next HandlerFunc) HandlerFunc
	AuthenticateFirebaseModIDToken(next HandlerFunc) HandlerFunc
	AuthenticateOIDCToken(next HandlerFunc) HandlerFunc
	AuthenticateWithSecret(next HandlerFunc) HandlerFunc
	AuthenticateAny(next HandlerFunc) HandlerFunc
}

type MintVideoTokenOption added in v0.1.796

type MintVideoTokenOption = Opt[MintVideoTokenOptions]

func WithMintVideoTokenRoomID added in v0.1.796

func WithMintVideoTokenRoomID(x *ID) MintVideoTokenOption

func WithMintVideoTokenTTL added in v0.1.796

func WithMintVideoTokenTTL(x time.Duration) MintVideoTokenOption

func WithMintVideoTokenUserID added in v0.1.796

func WithMintVideoTokenUserID(x *ID) MintVideoTokenOption

type MintVideoTokenOptions added in v0.1.796

type MintVideoTokenOptions struct {
	TTL    time.Duration
	UserID *ID
	RoomID *ID
}

func ApplyMintVideoTokenOptions added in v0.1.796

func ApplyMintVideoTokenOptions(opts *MintVideoTokenOptions, modifiers ...MintVideoTokenOption) MintVideoTokenOptions

type Modality added in v0.1.668

type Modality string

func (Modality) EmbeddingOptions added in v0.1.725

func (m Modality) EmbeddingOptions(opts EmbeddingIndexOptions) EmbeddingOptions

func (Modality) IsUnset added in v0.1.743

func (m Modality) IsUnset() bool

func (Modality) Pointer added in v0.1.668

func (m Modality) Pointer() *Modality

func (Modality) String added in v0.1.730

func (m Modality) String() string

func (Modality) Validate added in v0.1.668

func (m Modality) Validate() error

type Money added in v0.1.819

type Money struct{ *gm.Money }

Money is Fabriktor's curated wrapper around go-money.Money.

func NewMoney added in v0.1.819

func NewMoney(opts ...MoneyOption) *Money

func NewMoneyFrom added in v0.1.819

func NewMoneyFrom(m *gm.Money) *Money

type MoneyOperator added in v0.1.819

type MoneyOperator interface {
	BankersRound(ctx context.Context, a float64) (int64, error)
	Add(ctx context.Context, a, b *Money) (*Money, error)
	Subtract(ctx context.Context, a, b *Money) (*Money, error)
	Sum(ctx context.Context, a *Money, rest ...*Money) (*Money, error)
	SumSlice(ctx context.Context, s []*Money) (*Money, error)
	Amount(ctx context.Context, m *Money) (int64, error)
	Display(ctx context.Context, m *Money) (string, error)
}

type MoneyOption added in v0.1.819

type MoneyOption = Opt[moneyOptions]

func WithMoneyAmount added in v0.1.819

func WithMoneyAmount(x int64) MoneyOption

func WithMoneyCurrency added in v0.1.819

func WithMoneyCurrency(x string) MoneyOption

type MongoChangeStream added in v0.0.5

type MongoChangeStream interface {
	Close(ctx context.Context) error
	Next(ctx context.Context) bool
	Err() error
}

type MongoClient added in v0.0.5

type MongoClient interface {
	Database(name string, opts ...options.Lister[options.DatabaseOptions]) *mongo.Database
	StartSession(opts ...options.Lister[options.SessionOptions]) (*mongo.Session, error)
	Disconnect(ctx context.Context) error
}

type MongoCollection added in v0.0.5

type MongoCollection interface {
	InsertOne(ctx context.Context, document any, opts ...options.Lister[options.InsertOneOptions]) (*mongo.InsertOneResult, error)
	FindOne(ctx context.Context, filter any, opts ...options.Lister[options.FindOneOptions]) *mongo.SingleResult
	Find(ctx context.Context, filter any, opts ...options.Lister[options.FindOptions]) (*mongo.Cursor, error)
	ReplaceOne(ctx context.Context, filter any, document any, opts ...options.Lister[options.ReplaceOptions]) (*mongo.UpdateResult, error)
	DeleteOne(ctx context.Context, filter any, opts ...options.Lister[options.DeleteOneOptions]) (*mongo.DeleteResult, error)
	DeleteMany(ctx context.Context, filter any, opts ...options.Lister[options.DeleteManyOptions]) (*mongo.DeleteResult, error)
	Aggregate(ctx context.Context, pipeline any, opts ...options.Lister[options.AggregateOptions]) (*mongo.Cursor, error)
	Watch(ctx context.Context, pipeline any, opts ...options.Lister[options.ChangeStreamOptions]) (*mongo.ChangeStream, error)
}

type MongoCursor added in v0.0.5

type MongoCursor interface {
	Next(ctx context.Context) bool
	Decode(receiver any) error
	Err() error
}

type MongoDatabase added in v0.0.5

type MongoDatabase interface {
	Watch(ctx context.Context, pipeline any, opts ...options.Lister[options.ChangeStreamOptions]) (*mongo.ChangeStream, error)
}

type MongoFilter added in v0.0.5

type MongoFilter interface {
	Filter(ctx context.Context, opts FilterOptions) (bson.M, error)
	FilterByFieldInArray(ctx context.Context, opts FieldInArrayFilterOptions) (bson.M, error)
	FilterByElemMatch(ctx context.Context, opts ElemMatchFilterOptions) (bson.M, error)
	FilterByElemsInArray(ctx context.Context, opts ElemsInArrayFilterOptions) (bson.M, error)
	FilterByAllElemsInArray(ctx context.Context, opts ElemsInArrayFilterOptions) (bson.M, error)
	FilterByFutureDate(ctx context.Context, opts DateFilterOptions) (bson.D, error)
	FilterByPastDate(ctx context.Context, opts DateFilterOptions) (bson.D, error)
	FilterByExactDate(ctx context.Context, opts DateFilterOptions) (bson.D, error)
	CombineM(ctx context.Context, op BSONOperator, m ...bson.M) (bson.M, error)
}

type MongoLookupTarget added in v0.0.5

type MongoLookupTarget = string

MongoLookupTarget specifies the target field for the lookup stage in a MongoDB aggregation pipeline.

type MongoOperator added in v0.0.5

type MongoOperator interface {
	MongoUtil
	MongoFilter
	MongoSpecialized
	CloserWithCtx
}

type MongoOutCSChan added in v0.0.5

type MongoOutCSChan = chan *ChangeEvent

MongoOutCSChan is a channel type used for sending decoded MongoDB change events.

type MongoPipeliner added in v0.0.5

type MongoPipeliner interface {
	Pipeline() mongo.Pipeline
}

func NewPipeline added in v0.1.334

func NewPipeline(p mongo.Pipeline) MongoPipeliner

func NewPipelineReembedding added in v0.1.723

func NewPipelineReembedding(opts ReembeddingOptions) MongoPipeliner

type MongoSpecialized added in v0.0.5

type MongoSpecialized interface {
	Search(ctx context.Context, opts SearchOptions) (*SearchResult, error)
	WatchCollection(ctx context.Context, opts WatchCollectionOptions) error
	WatchDB(ctx context.Context, opts WatchDBOptions) error
	ProcessChangeStream(ctx context.Context, opts ProcessChangeStreamOptions) error
	RunPipeline(ctx context.Context, opts RunPipelineOptions) ([]any, error)
	CountFromPipeline(ctx context.Context, opts CountFromPipelineOptions) (int64, error)
}

type MongoUtil added in v0.0.5

type MongoUtil interface {
	WithTransaction(ctx context.Context, fn func(ctx context.Context) error) error
	Collection(ctx context.Context, db, collection string) (MongoCollection, error)
	Database(ctx context.Context, db string) (MongoDatabase, error)
}

type MongoVerb added in v0.0.5

type MongoVerb = string

MongoVerb defines a MongoDB operation keyword, such as match.

type MultipartBodyOption added in v0.1.515

type MultipartBodyOption = Opt[MultipartBodyOptions]

func WithMultipartBodyFiles added in v0.1.515

func WithMultipartBodyFiles(x []*MultipartFile) MultipartBodyOption

type MultipartBodyOptions added in v0.1.515

type MultipartBodyOptions struct {
	Files []*MultipartFile
}

func ApplyMultipartBodyOptions added in v0.1.515

func ApplyMultipartBodyOptions(opts *MultipartBodyOptions, modifiers ...MultipartBodyOption) MultipartBodyOptions

type MultipartFile added in v0.1.515

type MultipartFile struct {
	Data     []byte
	FileName string
}

type MultipartOperator added in v0.1.498

type MultipartOperator interface {
	NewMultipartBodySingle(ctx context.Context, f MultipartFile) (io.Reader, string, error)
	NewMultipartBodyMany(ctx context.Context, f []MultipartFile) (io.Reader, string, error)
	Store(ctx context.Context, r *http.Request, opts StoreOptions) error
	DecodeMultipartRequest(ctx context.Context, r *http.Request, fullQuality bool) ([]*BucketFile, error)
}

type NormalizeOption added in v0.1.336

type NormalizeOption = Opt[NormalizeOptions]

func WithRemoveDiacritics added in v0.1.336

func WithRemoveDiacritics() NormalizeOption

func WithRemoveDigits added in v0.1.336

func WithRemoveDigits() NormalizeOption

func WithRemoveNonASCII added in v0.1.336

func WithRemoveNonASCII() NormalizeOption

func WithRemovePunctuation added in v0.1.336

func WithRemovePunctuation() NormalizeOption

func WithRemoveSymbols added in v0.1.336

func WithRemoveSymbols() NormalizeOption

func WithToLower added in v0.1.336

func WithToLower() NormalizeOption

func WithTrimSpace added in v0.1.336

func WithTrimSpace() NormalizeOption

type NormalizeOptions added in v0.1.336

type NormalizeOptions struct {
	ToLower        bool
	RemoveDiacs    bool
	TrimSpace      bool
	RemovePunct    bool
	RemoveSpec     bool
	RemoveDigits   bool
	RemoveNonASCII bool
}

func ApplyNormalizeOptions added in v0.1.336

func ApplyNormalizeOptions(opts *NormalizeOptions, modifiers ...NormalizeOption) NormalizeOptions

type Normalizer added in v0.1.336

type Normalizer interface {
	Normalize(ctx context.Context, s string, opts NormalizeOptions) (string, error)
}

type NotifOperator added in v0.1.583

type NotifOperator interface{ Notifier }

type NotificationOptions added in v0.1.583

type NotificationOptions struct {
	TranslatedTitle string
	TranslatedBody  string
	Tokens          []string
	CustomData      map[string]string
	CustomSound     *string
	CustomImage     *string
	MaxTokensLen    int
}

func (*NotificationOptions) Validate added in v0.1.583

func (o *NotificationOptions) Validate(max int) error

type Notifier added in v0.1.583

type Notifier interface {
	SendNotif(ctx context.Context, opts NotificationOptions) (*SendResult, error)
	BatchSendNotif(ctx context.Context, opts NotificationOptions) (*BatchSendResult, error)
}

type OIDCAuthenticator added in v0.1.178

type OIDCAuthenticator interface {
	AuthenticateOIDCToken(ctx context.Context, r *http.Request, opts AuthOptions) error
}

type OIDCCreator added in v0.1.178

type OIDCCreator interface {
	CreateOIDCToken(ctx context.Context) (*oauth2.Token, error)
}

type OIDCOperator added in v0.1.178

type OIDCOperator interface {
	OIDCAuthenticator
	OIDCCreator
}

type OpenStripeAccountOption added in v0.1.843

type OpenStripeAccountOption = Opt[OpenStripeAccountOptions]

func WithOpenStripeAccountCountry added in v0.1.843

func WithOpenStripeAccountCountry(x string) OpenStripeAccountOption

func WithOpenStripeAccountCurrency added in v0.1.843

func WithOpenStripeAccountCurrency(x string) OpenStripeAccountOption

func WithOpenStripeAccountEmail added in v0.1.843

func WithOpenStripeAccountEmail(x string) OpenStripeAccountOption

func WithOpenStripeAccountMetadata added in v0.1.923

func WithOpenStripeAccountMetadata(x map[string]string) OpenStripeAccountOption

type OpenStripeAccountOptions added in v0.1.843

type OpenStripeAccountOptions struct {
	Country  string
	Currency string
	Email    string
	Metadata map[string]string
}

func ApplyOpenStripeAccountOptions added in v0.1.843

func ApplyOpenStripeAccountOptions(opts *OpenStripeAccountOptions, modifiers ...OpenStripeAccountOption) OpenStripeAccountOptions

func (*OpenStripeAccountOptions) Params added in v0.1.845

func (*OpenStripeAccountOptions) Validate added in v0.1.843

func (o *OpenStripeAccountOptions) Validate() error

type OpenStripePaymentOption added in v0.1.843

type OpenStripePaymentOption = Opt[OpenStripePaymentOptions]

func WithOpenStripePaymentAmount added in v0.1.843

func WithOpenStripePaymentAmount(x int64) OpenStripePaymentOption

func WithOpenStripePaymentAppFeesRate added in v0.1.845

func WithOpenStripePaymentAppFeesRate(x int64) OpenStripePaymentOption

func WithOpenStripePaymentBypass added in v0.1.843

func WithOpenStripePaymentBypass(x bool) OpenStripePaymentOption

func WithOpenStripePaymentConnectedAccountID added in v0.1.845

func WithOpenStripePaymentConnectedAccountID(x *ID) OpenStripePaymentOption

func WithOpenStripePaymentCurrency added in v0.1.843

func WithOpenStripePaymentCurrency(x string) OpenStripePaymentOption

func WithOpenStripePaymentIsPayroll added in v0.1.843

func WithOpenStripePaymentIsPayroll(x bool) OpenStripePaymentOption

func WithOpenStripePaymentMetadata added in v0.1.843

func WithOpenStripePaymentMetadata(x map[string]string) OpenStripePaymentOption

func WithOpenStripePaymentOffSession added in v0.1.843

func WithOpenStripePaymentOffSession(x bool) OpenStripePaymentOption

func WithOpenStripePaymentPaidToFabriktor added in v0.1.843

func WithOpenStripePaymentPaidToFabriktor(x bool) OpenStripePaymentOption

func WithOpenStripePaymentPaymentMethodID added in v0.1.912

func WithOpenStripePaymentPaymentMethodID(x *ID) OpenStripePaymentOption

func WithOpenStripePaymentReceiptEmail added in v0.1.843

func WithOpenStripePaymentReceiptEmail(x string) OpenStripePaymentOption

func WithOpenStripePaymentReturnURL added in v0.1.843

func WithOpenStripePaymentReturnURL(x string) OpenStripePaymentOption

func WithOpenStripePaymentUseStripeSDK added in v0.1.843

func WithOpenStripePaymentUseStripeSDK(x bool) OpenStripePaymentOption

type OpenStripePaymentOptions added in v0.1.843

type OpenStripePaymentOptions struct {
	StripeConnectedAccountID
	StripeBypass
	PaymentMethodID *ID
	UseStripeSDK    bool
	OffSession      bool
	IsPayroll       bool
	PaidToFabriktor bool
	Currency        string
	ReturnURL       string
	ReceiptEmail    string
	Amount          int64
	Metadata        map[string]string
	// AppFeesRate is the application fee rate stored as a fraction of 1 scaled by 100000.
	AppFeesRate int64
}

func ApplyOpenStripePaymentOptions added in v0.1.843

func ApplyOpenStripePaymentOptions(opts *OpenStripePaymentOptions, modifiers ...OpenStripePaymentOption) OpenStripePaymentOptions

func (*OpenStripePaymentOptions) Params added in v0.1.845

func (*OpenStripePaymentOptions) Validate added in v0.1.843

func (o *OpenStripePaymentOptions) Validate() error

type Opener added in v0.1.498

type Opener interface {
	Open(ctx context.Context, path string) (io.ReadCloser, error)
}

type OperationResult added in v0.1.56

type OperationResult struct {
	// Message is the optional operation message.
	Message string `json:"message,omitempty"`
	// ID is the optional ressource identifier.
	ID *ID `json:"id,omitempty"`
	// Value is an optional result object.
	Value any `json:"value,omitempty"`
}

OperationResult is a general-purpose response struct.

func NewOperationResult added in v0.1.57

func NewOperationResult(opts ...OperationResultOption) *OperationResult

type OperationResultOption added in v0.1.56

type OperationResultOption = Opt[OperationResult]

func WithID added in v0.1.56

func WithID(x *ID) OperationResultOption

func WithMessage added in v0.1.56

func WithMessage(x string) OperationResultOption

func WithValue added in v0.1.56

func WithValue(x any) OperationResultOption

type Opt added in v0.1.795

type Opt[T any] func(*T)

type PLPull added in v0.1.675

type PLPull interface {
	GetOwnerID() ID
	GetSessionToken() string
	GetIsNewSession() bool
	GetPullType() PullType
	GetEntityID() ID
}

type PSPActionableStatus added in v0.1.846

type PSPActionableStatus string

PSPActionableStatus represents the provider-reported execution state of an operation, including whether further action is required.

func (*PSPActionableStatus) Validate added in v0.1.846

func (x *PSPActionableStatus) Validate() error

type PSPBankAccountHolderType added in v0.1.849

type PSPBankAccountHolderType string

PSPBankAccountHolderType represents the provider-reported type of bank account holder.

func (*PSPBankAccountHolderType) Validate added in v0.1.849

func (x *PSPBankAccountHolderType) Validate() error

type PSPEventType added in v0.1.927

type PSPEventType string

PSPEventType represents the provider-reported webhook event type.

func (*PSPEventType) Validate added in v0.1.927

func (x *PSPEventType) Validate() error

type PSPExpiryStatus added in v0.1.845

type PSPExpiryStatus string

PSPExpiryStatus represents the provider-reported expiration state of a payment instrument.

func (*PSPExpiryStatus) Validate added in v0.1.845

func (x *PSPExpiryStatus) Validate() error

type PSPFeesPayer added in v0.1.848

type PSPFeesPayer string

PSPFeesPayer represents the provider-reported party responsible for paying fees.

func (*PSPFeesPayer) Validate added in v0.1.848

func (x *PSPFeesPayer) Validate() error

type PSPPaymentStatus added in v0.1.848

type PSPPaymentStatus string

PSPPaymentStatus represents the provider-reported settlement state of a payment.

func (*PSPPaymentStatus) Validate added in v0.1.848

func (x *PSPPaymentStatus) Validate() error

type PSPRefundReason added in v0.1.847

type PSPRefundReason string

PSPRefundReason represents the provider-reported reason for a refund.

func (*PSPRefundReason) Validate added in v0.1.847

func (x *PSPRefundReason) Validate() error

type PState added in v0.1.699

type PState map[string]*Blob

func (PState) IDKeys added in v0.1.755

func (p PState) IDKeys() []*ID

func (PState) Keys added in v0.1.755

func (p PState) Keys() []string

type PaginationOptions added in v0.0.5

type PaginationOptions struct {
	PageNumber int32
	PageSize   int32
}

func (*PaginationOptions) Validate added in v0.1.498

func (p *PaginationOptions) Validate() error

type Parser added in v0.1.336

type Parser interface {
	ParseDynamicType(ctx context.Context, s string) (any, error)
	ParseQueryString(ctx context.Context, s string) (map[string][]string, error)
}

type Path added in v0.1.684

type Path = string

type PayType added in v0.1.828

type PayType string

func (PayType) Equal added in v0.1.841

func (x PayType) Equal(other PayType) bool

func (*PayType) Validate added in v0.1.828

func (x *PayType) Validate() error

type PaymentEntityType added in v0.1.848

type PaymentEntityType string

PaymentEntityType represents the application-level type of entity a payment is associated with.

func (*PaymentEntityType) Validate added in v0.1.848

func (x *PaymentEntityType) Validate() error

type PeriodOperator added in v0.1.10

type PeriodOperator interface {
	FirstPeriodStartDate(ctx context.Context, year int) (*Dt, error)
	LastDayOfLastPeriod(ctx context.Context, year int) (*Dt, error)
	FirstDayOfMonth(ctx context.Context, date *Dt) (*Dt, error)
	PeriodNumber(ctx context.Context, date *Dt) (int, error)
	TimeOfPeriodWeekday(ctx context.Context, date *Dt, w time.Weekday) (*Dt, error)
	PeriodBounds(ctx context.Context, date *Dt) (*Dt, *Dt, error)
	CloneWithOffset(ctx context.Context, x int) (PeriodOperator, error)
}

type PoolOperator added in v0.1.10

type PoolOperator interface {
	Acquire(ctx context.Context) error
	Release(ctx context.Context) error
	ActiveWorkers(ctx context.Context) (int, error)
	WaitAll(ctx context.Context) error
	Shutdown(ctx context.Context) error
	CloneWithConcurrency(ctx context.Context, x int) (PoolOperator, error)
}

type PostType added in v0.1.699

type PostType string

func (PostType) String added in v0.1.699

func (p PostType) String() string

func (*PostType) Validate added in v0.1.699

func (p *PostType) Validate() error

type ProcessChangeStreamOptions added in v0.0.5

type ProcessChangeStreamOptions struct {
	ChangeStream MongoChangeStream
	LookupKey    string
	Receiver     any
	Output       MongoOutCSChan
}

type Prompt added in v0.1.721

type Prompt struct {
	SystemPrompt string
	UserPrompt   string
}

type PromptMessage added in v0.1.245

type PromptMessage struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

PromptMessage represents a message in the conversation. For contextual messages, see:

type PromptOption added in v0.1.698

type PromptOption = Opt[PromptOptions]

func WithPromptAdditionalOpts added in v0.1.698

func WithPromptAdditionalOpts(x map[string]any) PromptOption

func WithPromptContext added in v0.1.698

func WithPromptContext(x []PromptMessage) PromptOption

func WithPromptResponseFormat added in v0.1.698

func WithPromptResponseFormat(x *PromptResponseFormat) PromptOption

func WithPromptSystemPrompt added in v0.1.698

func WithPromptSystemPrompt(x string) PromptOption

func WithPromptTemperature added in v0.1.698

func WithPromptTemperature(x float64) PromptOption

func WithPromptUserPrompt added in v0.1.698

func WithPromptUserPrompt(x string) PromptOption

type PromptOptions added in v0.1.698

type PromptOptions struct {
	Prompt
	Context        []PromptMessage
	Temperature    float64
	R              *PromptResponseFormat
	AdditionalOpts map[string]any
}

func ApplyPromptOptions added in v0.1.698

func ApplyPromptOptions(opts *PromptOptions, modifiers ...PromptOption) PromptOptions

type PromptResponseFormat added in v0.1.245

type PromptResponseFormat struct {
	Type       string        `json:"type"`
	JSONSchema *schemaFormat `json:"json_schema,omitempty"`
}

PromptResponseFormat represents the response format customization.

type PrompterOperator added in v0.1.702

type PrompterOperator interface {
	Prompt(ctx context.Context, opts PromptOptions) (string, error)
}

type PubSubAdminOperator added in v0.1.609

type PubSubAdminOperator interface {
	CreateTopic(ctx context.Context, req *pubsubpb.Topic) (*pubsubpb.Topic, error)
	CreateSubscription(ctx context.Context, req *pubsubpb.Subscription) (*pubsubpb.Subscription, error)
	GetTopic(ctx context.Context, req *pubsubpb.GetTopicRequest) (*pubsubpb.Topic, error)
	ListTopicSubscriptions(ctx context.Context, req *pubsubpb.ListTopicSubscriptionsRequest) *pubsubapiv1.StringIterator
}

type PubSubClient added in v0.1.162

type PubSubClient interface {
	Publisher(topicNameOrID string) *pubsub.Publisher
	Subscriber(subNameOrID string) *pubsub.Subscriber
	Closer
}

type PubSubFamily added in v0.1.162

type PubSubFamily struct {
	Topic             *PubSubTopic
	PushSubscriptions []*PubSubPushSubscription
	PullSubscriptions []*PubSubPullSubscription
}

type PubSubKey added in v0.1.366

type PubSubKey = string

func ToPubSubKey added in v0.1.366

func ToPubSubKey(s string) PubSubKey

ToPubSubKey converts a string to lowercase.

type PubSubMessage added in v0.0.5

type PubSubMessage interface {
	GetData() []byte
	GetAttributes() map[string]string
	GetMessageID() string
	GetPublishTime() time.Time
}

type PubSubOperator added in v0.1.10

type PubSubOperator interface {
	MockPayload(ctx context.Context, msg PubSubMessage, sub string) (*PubSubPayload, error)
	DecodePayload(ctx context.Context, r *http.Request) (PubSubMessage, error)
	Publish(ctx context.Context, topicID string, msg *pubsub.Message) error
	NewMessage(ctx context.Context, data string, attrs map[string]string) (*pubsub.Message, error)
	NewAttributes(ctx context.Context, attrs ...string) (map[string]string, error)
	CloserWithCtx
}

type PubSubPayload added in v0.1.367

type PubSubPayload struct {
	Message      pubsub.Message `json:"message"`
	Subscription string         `json:"subscription,omitempty"`
}

type PubSubPullSubscription added in v0.1.162

type PubSubPullSubscription struct {
	ID string
}

type PubSubPushSubscription added in v0.1.162

type PubSubPushSubscription struct {
	ID           string
	PushEndpoint string
}

type PubSubTopic added in v0.1.162

type PubSubTopic struct {
	ID string
}

type PullFactoryOperator added in v0.1.676

type PullFactoryOperator interface {
	NewPullPayload(ctx context.Context, ressource string) (PLPull, error)
	NewPullSession(ctx context.Context, ressource string) (PullSession, error)
	NewPullSubFunc(ctx context.Context, ressource string, p PullType) (PullSubFunc, error)
}

type PullHandlerOptions added in v0.1.681

type PullHandlerOptions struct {
	SessionRessource string
}

type PullSession added in v0.1.680

type PullSession interface {
	SeedFromPull(p PLPull)
}

type PullSubFunc added in v0.1.676

type PullSubFunc func(ctx context.Context, opts PullSubFuncOptions) (any, error)

type PullSubFuncOption added in v0.1.685

type PullSubFuncOption = Opt[PullSubFuncOptions]

func WithPullSubFuncPayload added in v0.1.685

func WithPullSubFuncPayload(x PLPull) PullSubFuncOption

func WithPullSubFuncRequest added in v0.1.685

func WithPullSubFuncRequest(x *http.Request) PullSubFuncOption

func WithPullSubFuncSession added in v0.1.685

func WithPullSubFuncSession(x PullSession) PullSubFuncOption

func WithPullSubFuncToolbox added in v0.1.685

func WithPullSubFuncToolbox(x any) PullSubFuncOption

type PullSubFuncOptions added in v0.1.685

type PullSubFuncOptions struct {
	R       *http.Request
	Toolbox any
	S       PullSession
	PL      PLPull
}

func ApplyPullSubFuncOptions added in v0.1.685

func ApplyPullSubFuncOptions(opts *PullSubFuncOptions, modifiers ...PullSubFuncOption) PullSubFuncOptions

type PullType added in v0.1.687

type PullType uint
const (
	PullTypeBatch PullType = iota
	PullTypeSingle
	PullTypeKeepAlive
	PullTypeResearch
	PullTypeReactions
	PullTypeReferences
	PullTypeReplies
	PullTypeProfilePosts
	PullTypeProfileReplies
	PullTypeProfileMedias
)

type PunchMode added in v0.1.699

type PunchMode string

func (PunchMode) Validate added in v0.1.699

func (p PunchMode) Validate() error

type PunchStatus added in v0.1.699

type PunchStatus string

func (PunchStatus) Validate added in v0.1.699

func (p PunchStatus) Validate() error

type PunchType added in v0.1.699

type PunchType string

func (PunchType) Validate added in v0.1.699

func (p PunchType) Validate() error

type QRCode added in v0.1.594

type QRCode struct {
	Content         io.Reader
	BgColor         color.Color
	FgColor         color.Color
	BorderWidth     uint8
	BlockWidth      uint8
	WithCircleShape bool
	WithWatermark   bool
}

type QROperator added in v0.1.594

type QROperator interface {
	Generate(ctx context.Context, x QRCode) ([]byte, error)
}

type QueryHandlerOptions added in v0.1.274

type QueryHandlerOptions struct {
	Atz
	Bypass
}

type QueryParamRule added in v0.1.5

type QueryParamRule struct {
	Key                   string   // Name of the query parameter.
	DefaultValue          string   // Default value if not provided in the request.
	AcceptedValues        []string // Accepted values; nil allows any value.
	MultipleValuesAllowed bool     // Whether multiple values are permitted.
	Optional              bool     // Whether the parameter is optional.
}

QueryParamRule defines validation rules for a query parameter. It specifies constraints such as key, default value, allowed values, and multiplicity.

type QueryParamRules added in v0.1.72

type QueryParamRules []QueryParamRule

func (*QueryParamRules) AppendMany added in v0.1.73

func (q *QueryParamRules) AppendMany(r QueryParamRules)

AppendMany appends multiple QueryParamRules to the QueryParamRules.

func (*QueryParamRules) AppendOne added in v0.1.73

func (q *QueryParamRules) AppendOne(r QueryParamRule)

AppendOne appends a QueryParamRule to the QueryParamRules.

type Queryable added in v0.1.68

type Queryable interface {
	Rules() QueryParamRules
}

type RangeOption added in v0.1.338

type RangeOption = Opt[RangeOptions]

func WithMax added in v0.1.338

func WithMax(x float64) RangeOption

func WithMin added in v0.1.338

func WithMin(x float64) RangeOption

type RangeOptions added in v0.1.338

type RangeOptions struct {
	Min float64
	Max float64
}

func ApplyRangeOptions added in v0.1.338

func ApplyRangeOptions(opts *RangeOptions, modifiers ...RangeOption) RangeOptions

type RawCacheKey added in v0.1.3

type RawCacheKey string

RawCacheKey wraps a string key to implement fmt.Stringer.

func (RawCacheKey) String added in v0.1.3

func (r RawCacheKey) String() string

String implements the Stringer interface for RawCacheKey.

type Reader

type Reader interface {
	Read(ctx context.Context, r io.Reader) ([]byte, error)
}

type RecurrenceEndType added in v0.1.699

type RecurrenceEndType = string

type RecurrenceType added in v0.1.699

type RecurrenceType = string

type RedisClient added in v0.0.5

type RedisClient interface {
	Closer
	Get(ctx context.Context, key string) *redis.StringCmd
	Set(ctx context.Context, key string, value any, expiration time.Duration) *redis.StatusCmd
	FlushAll(ctx context.Context) *redis.StatusCmd
	Scan(ctx context.Context, cursor uint64, match string, count int64) *redis.ScanCmd
	TxPipeline() redis.Pipeliner
	Exists(ctx context.Context, keys ...string) *redis.IntCmd
	Pipeline() redis.Pipeliner
	Eval(ctx context.Context, script string, keys []string, args ...any) *redis.Cmd
}

type RedisOperator added in v0.1.10

type RedisOperator interface {
	Cacher
	ArbiterOperator
	ArbiterTokenizer
	CloserWithCtx
}

type ReembeddingOption added in v0.1.723

type ReembeddingOption = Opt[ReembeddingOptions]

func WithReembeddingDimensionKey added in v0.1.723

func WithReembeddingDimensionKey(x string) ReembeddingOption

func WithReembeddingEmbeddingVersionKey added in v0.1.723

func WithReembeddingEmbeddingVersionKey(x string) ReembeddingOption

func WithReembeddingLimit added in v0.1.723

func WithReembeddingLimit(x int64) ReembeddingOption

func WithReembeddingModality added in v0.1.723

func WithReembeddingModality(x Modality) ReembeddingOption

func WithReembeddingModalityKey added in v0.1.733

func WithReembeddingModalityKey(x string) ReembeddingOption

type ReembeddingOptions added in v0.1.723

type ReembeddingOptions struct {
	Modality            Modality
	Limit               int64
	EmbeddingVersionKey string
	DimensionKey        string
	ModalityKey         string
}

func ApplyReembeddingOptions added in v0.1.723

func ApplyReembeddingOptions(opts *ReembeddingOptions, modifiers ...ReembeddingOption) ReembeddingOptions

func (*ReembeddingOptions) Validate added in v0.1.723

func (o *ReembeddingOptions) Validate() error

type ReflectOperator added in v0.1.10

type ReflectOperator interface {
	FillNilPointers(ctx context.Context, to, from any) error
}

type RefundStripePaymentOption added in v0.1.843

type RefundStripePaymentOption = Opt[RefundStripePaymentOptions]

func WithRefundStripePaymentAmount added in v0.1.843

func WithRefundStripePaymentAmount(x int64) RefundStripePaymentOption

func WithRefundStripePaymentBypass added in v0.1.843

func WithRefundStripePaymentBypass(x bool) RefundStripePaymentOption

func WithRefundStripePaymentConnectedAccountID added in v0.1.845

func WithRefundStripePaymentConnectedAccountID(x *ID) RefundStripePaymentOption

func WithRefundStripePaymentMetadata added in v0.1.923

func WithRefundStripePaymentMetadata(x map[string]string) RefundStripePaymentOption

func WithRefundStripePaymentPaymentIntentID added in v0.1.843

func WithRefundStripePaymentPaymentIntentID(x *ID) RefundStripePaymentOption

func WithRefundStripePaymentReason added in v0.1.843

func WithRefundStripePaymentReason(x string) RefundStripePaymentOption

func WithRefundStripePaymentRefundApplicationFee added in v0.1.920

func WithRefundStripePaymentRefundApplicationFee(x bool) RefundStripePaymentOption

type RefundStripePaymentOptions added in v0.1.843

type RefundStripePaymentOptions struct {
	StripeConnectedAccountID
	StripeBypass
	Amount               int64
	Reason               string
	RefundApplicationFee bool
	PaymentIntentID      *ID
	Metadata             map[string]string
}

func ApplyRefundStripePaymentOptions added in v0.1.843

func ApplyRefundStripePaymentOptions(opts *RefundStripePaymentOptions, modifiers ...RefundStripePaymentOption) RefundStripePaymentOptions

func (*RefundStripePaymentOptions) Params added in v0.1.845

func (*RefundStripePaymentOptions) Validate added in v0.1.843

func (o *RefundStripePaymentOptions) Validate() error

type RegisteredRoute added in v0.1.10

type RegisteredRoute struct {
	MethodMap map[string]Entry
}

RegisteredRoute holds a map of HTTP methods to route entries.

type Registry added in v0.1.10

type Registry map[*regexp.Regexp]*RegisteredRoute

Registry maps compiled regex patterns to registered routes.

func (*Registry) LenHandlers added in v0.1.10

func (r *Registry) LenHandlers() int

LenHandlers returns the total number of handlers across all routes.

func (*Registry) LenRoutes added in v0.1.10

func (r *Registry) LenRoutes() int

LenRoutes returns the number of registered routes.

type RegistryMutex added in v0.1.10

type RegistryMutex struct {
	sync.RWMutex
}

RegistryMutex provides thread-safe access to the route registry.

type Relation added in v0.1.699

type Relation = int64
const (
	Na      Relation = iota // Not applicable, for initial friend request only.
	Friend                  // Between all types of users.
	OldHire                 // Between employees and employers only, when the employee is fired.
	Hired                   // Between employees and employers only.
	Manager                 // Between employees and employers only.
)

type RenderOption added in v0.1.385

type RenderOption = Opt[RenderOptions]

func WithData added in v0.1.385

func WithData(x any) RenderOption

func WithEmailable added in v0.1.385

func WithEmailable(x Emailable) RenderOption

func WithFuncs added in v0.1.385

func WithFuncs(x template.FuncMap) RenderOption

func WithRenderWriter added in v0.1.385

func WithRenderWriter(x io.Writer) RenderOption

func WithTemplate added in v0.1.385

func WithTemplate(x string) RenderOption

type RenderOptions added in v0.1.385

type RenderOptions struct {
	Template string
	Data     any
	W        io.Writer
	Funcs    template.FuncMap
}

func ApplyRenderOptions added in v0.1.385

func ApplyRenderOptions(opts *RenderOptions, modifiers ...RenderOption) RenderOptions

type RentalType added in v0.1.806

type RentalType string

RentalType represents how equipment is billed over time.

const (
	RentalHourly RentalType = "hourly"
	RentalDaily  RentalType = "daily"
)

func (*RentalType) Validate added in v0.1.808

func (x *RentalType) Validate() error

type ReplaceOneHandlerOptions added in v0.1.270

type ReplaceOneHandlerOptions struct {
	Atz
	Bypass
}

type ReplaceOneOptions added in v0.0.5

type ReplaceOneOptions struct {
	Collection string
	Document   Identifiable
	IDKey      string
	ID         Identifier
}

type RequestOption

type RequestOption = Opt[RequestOptions]

func WithRequestBody

func WithRequestBody(x io.Reader) RequestOption

func WithRequestHeader

func WithRequestHeader(x http.Header) RequestOption

type RequestOptions

type RequestOptions struct {
	Header http.Header
	Body   io.Reader
}

func ApplyRequestOptions

func ApplyRequestOptions(opts *RequestOptions, modifiers ...RequestOption) RequestOptions

type RequestWeight added in v0.1.10

type RequestWeight = uint

RequestWeight defines the relative cost of a request for rate limiting.

const (
	// Unlimited disables rate limiting for the request.
	Unlimited RequestWeight = 0
)

type RequireOption added in v0.1.338

type RequireOption = Opt[RequireOptions]

func WithNonNilPointer added in v0.1.338

func WithNonNilPointer() RequireOption

func WithNonZeroValue added in v0.1.338

func WithNonZeroValue() RequireOption

type RequireOptions added in v0.1.338

type RequireOptions struct {
	NonNilPointer bool
	NonZeroValue  bool
}

func ApplyRequireOptions added in v0.1.338

func ApplyRequireOptions(opts *RequireOptions, modifiers ...RequireOption) RequireOptions

type ResultKey added in v0.1.770

type ResultKey = string

ResultKey represents the key used to access the result in a MongoDB aggregation pipeline.

type Role added in v0.1.50

type Role int
const (
	NA Role = iota
	Rdr
	Wrtr
	Ownr
)

func (Role) Validate added in v0.1.50

func (r Role) Validate() error

type Route added in v0.1.10

type Route struct {
	Svc         string
	Pairs       []string
	HandlerFunc HandlerFunc
	Weight      uint
	Methods     []string
}

Route holds route metadata to be compiled and registered.

func (Route) CompileRegex added in v0.1.10

func (r Route) CompileRegex(pathKey string) (*regexp.Regexp, error)

CompileRegex builds a compiled regex for matching the route.

func (*Route) Validate added in v0.1.10

func (r *Route) Validate() error

type RouterKeyExtractor added in v0.1.198

type RouterKeyExtractor interface {
	SvcKey(ctx context.Context) (string, error)
	RKey(ctx context.Context) (string, error)
}

type RouterOperator added in v0.1.10

type RouterOperator interface {
	RouterParser
	RouterKeyExtractor
	Run(ctx context.Context) error
	Mount(ctx context.Context, r []*Route) error
	Stop(ctx context.Context) error
	Vars(ctx context.Context) (*config.Vars, error)
	AttachServer(ctx context.Context, s ServerOperator) error
}

type RouterParser added in v0.1.27

type RouterParser interface {
	ParsePath(ctx context.Context, r *http.Request, re *regexp.Regexp) (map[string]string, error)
	ParseQuery(ctx context.Context, r *http.Request) (map[string][]string, error)
}

type RunGuardsOption added in v0.1.830

type RunGuardsOption = Opt[RunGuardsOptions]

func WithRunGuardsG added in v0.1.831

func WithRunGuardsG(x []GuardRunner) RunGuardsOption

type RunGuardsOptions added in v0.1.830

type RunGuardsOptions struct {
	G []GuardRunner
}

func ApplyRunGuardsOptions added in v0.1.830

func ApplyRunGuardsOptions(opts *RunGuardsOptions, modifiers ...RunGuardsOption) RunGuardsOptions

type RunPipelineOptions added in v0.1.79

type RunPipelineOptions struct {
	Collection string
	Receiver   any
	Pipeline   MongoPipeliner
}

type SMS added in v0.1.795

type SMS interface {
	SendPlainSMS(ctx context.Context, s sms.SMS) ([]byte, error)
}

type SNum added in v0.1.833

type SNum[T Signed] struct {
	Raw  *T      `json:"raw" validate:"nnpt"`
	Text *string `json:"text" validate:"nnpt,nz"`
}

SNum stores a numeric value and its text form for searchable numerical fields.

func NewSNum added in v0.1.833

func NewSNum[T Signed](opts ...SNumOption[T]) *SNum[T]

func NewZeroSNum added in v0.1.836

func NewZeroSNum[T Signed]() *SNum[T]

func (*SNum[T]) FormatText added in v0.1.833

func (s *SNum[T]) FormatText() *SNum[T]

func (*SNum[T]) GetRaw added in v0.1.833

func (s *SNum[T]) GetRaw() T

func (*SNum[T]) GetText added in v0.1.833

func (s *SNum[T]) GetText() string

func (*SNum[T]) SetRaw added in v0.1.833

func (s *SNum[T]) SetRaw(x T)

func (*SNum[T]) SetText added in v0.1.833

func (s *SNum[T]) SetText(x string)

type SNumOption added in v0.1.837

type SNumOption[T Signed] func(*SNum[T])

func WithSNumRaw added in v0.1.833

func WithSNumRaw[T Signed](x T) SNumOption[T]

func WithSNumText added in v0.1.833

func WithSNumText[T Signed](x string) SNumOption[T]

type ScanManyOption added in v0.1.478

type ScanManyOption = Opt[ScanManyOptions]

func WithScanManyCheck added in v0.1.478

func WithScanManyCheck(x func(context.Context, io.Reader) (bool, error)) ScanManyOption

func WithScanManyConcurrency added in v0.1.558

func WithScanManyConcurrency(x *int) ScanManyOption

func WithScanManyCopier added in v0.1.758

func WithScanManyCopier(x Copier) ScanManyOption

func WithScanManyPool added in v0.1.478

func WithScanManyPool(x PoolOperator) ScanManyOption

func WithScanManyReader added in v0.1.478

func WithScanManyReader(x Reader) ScanManyOption

type ScanManyOptions added in v0.1.478

type ScanManyOptions struct {
	P           PoolOperator
	R           Reader
	CP          Copier
	Check       func(context.Context, io.Reader) (bool, error)
	Concurrency *int
}

func ApplyScanManyOptions added in v0.1.478

func ApplyScanManyOptions(opts *ScanManyOptions, modifiers ...ScanManyOption) ScanManyOptions

type Scopable added in v0.1.60

type Scopable interface {
	Scope() Scope
}

type Scope added in v0.1.66

type Scope struct {
	K  string
	ID ID
}

type SearchIndexEntry added in v0.0.5

type SearchIndexEntry struct {
	Fields AtlasIndexes
	E      *EmbeddingOptions
}

SearchIndexEntry defines a MongoDB Atlas search index specification. INFO: Two modes:

  • Text search (E == nil): all Fields are indexed as text.
  • Vector search (E != nil): creates vector index; Fields is ignored.

type SearchManyHandlerOptions added in v0.1.270

type SearchManyHandlerOptions struct {
	Atz
	Filter        bson.M
	SortByKey     string
	SortDirection SortDirection
}

type SearchOptions added in v0.0.5

type SearchOptions struct {
	SearchManyHandlerOptions
	Collection string
	Receiver   any
	T          *TextOptions
	P          *PaginationOptions
}

type SearchResult added in v0.1.56

type SearchResult struct {
	Results    []any `json:"results,omitempty"`
	TotalCount int64 `json:"total_count,omitempty"`
	LastPage   int32 `json:"last_page,omitempty"`
}

SearchResult represents the response from a search operation.

func NewSearchResult added in v0.1.57

func NewSearchResult(opts ...SearchResultOption) *SearchResult

type SearchResultOption added in v0.1.56

type SearchResultOption = Opt[SearchResult]

func WithSearchLastPage added in v0.1.56

func WithSearchLastPage(x int32) SearchResultOption

func WithSearchResults added in v0.1.56

func WithSearchResults(x []any) SearchResultOption

func WithSearchTotalCount added in v0.1.56

func WithSearchTotalCount(x int64) SearchResultOption

type Searchable added in v0.1.75

type Searchable interface {
	SearchIn() []string
}

type SecretInfo added in v0.1.13

type SecretInfo struct {
	SecretID  string
	VersionID string
}

SecretInfo holds the identifiers needed to access a secret.

func (SecretInfo) BuildSecretName added in v0.1.13

func (s SecretInfo) BuildSecretName(projectID string) string

BuildSecretName constructs the full secret name path for Secret Manager.

type SecretManagerClient added in v0.1.13

type SecretManagerClient interface {
	AccessSecretVersion(ctx context.Context, req *secretmanagerpb.AccessSecretVersionRequest, opts ...gax.CallOption) (*secretmanagerpb.AccessSecretVersionResponse, error)
	Close() error
}

type SecretOperator added in v0.1.13

type SecretOperator interface {
	GetSecret(ctx context.Context, s SecretInfo) ([]byte, error)
	CloserWithCtx
}

type SemaphoreInfo added in v0.1.11

type SemaphoreInfo interface {
	GetConcurrency(ctx context.Context) (int, error)
}

type SemaphoreOperator added in v0.1.10

type SemaphoreOperator interface {
	Acquire(ctx context.Context) error
	Release(ctx context.Context) error
	WaitAll(ctx context.Context) error
	SemaphoreInfo
}

type SendEmailOption added in v0.1.381

type SendEmailOption = Opt[SendEmailOptions]

func WithBcc added in v0.1.381

func WithBcc(x ...string) SendEmailOption

func WithCc added in v0.1.381

func WithCc(x ...string) SendEmailOption

func WithContent added in v0.1.381

func WithContent(x io.Reader) SendEmailOption

func WithSender added in v0.1.381

func WithSender(x *EmailSenderInfo) SendEmailOption

func WithSubject added in v0.1.381

func WithSubject(x string) SendEmailOption

func WithTo added in v0.1.381

func WithTo(x ...string) SendEmailOption

type SendEmailOptions added in v0.1.381

type SendEmailOptions struct {
	Sender  *EmailSenderInfo
	Subject string
	Content io.Reader
	To      []string
	Cc      []string
	Bcc     []string
}

func ApplySendEmailOptions added in v0.1.381

func ApplySendEmailOptions(opts *SendEmailOptions, modifiers ...SendEmailOption) SendEmailOptions

type SendResult added in v0.1.583

type SendResult struct {
	Token     string
	Success   bool
	MessageID string
	Error     string
}

type ServeFileOption added in v0.1.377

type ServeFileOption = Opt[ServeFileOptions]

func WithReplacePath added in v0.1.377

func WithReplacePath(x string) ServeFileOption

func WithRequest added in v0.1.377

func WithRequest(x *http.Request) ServeFileOption

func WithStripPrefix added in v0.1.377

func WithStripPrefix(x string) ServeFileOption

func WithWriter added in v0.1.377

func WithWriter(x http.ResponseWriter) ServeFileOption

type ServeFileOptions added in v0.1.377

type ServeFileOptions struct {
	W         http.ResponseWriter
	R         *http.Request
	ToStrip   string
	ToReplace string
}

func ApplyServeFileOptions added in v0.1.377

func ApplyServeFileOptions(opts *ServeFileOptions, modifiers ...ServeFileOption) ServeFileOptions

type ServerInfo added in v0.1.11

type ServerInfo interface {
	GetUseHTTP2(ctx context.Context) (bool, error)
	GetUseH2C(ctx context.Context) (bool, error)
	GetBoundOn(ctx context.Context) (string, error)
	GetIdleTimeout(ctx context.Context) (time.Duration, error)
	GetReadTimeout(ctx context.Context) (time.Duration, error)
	GetWriteTimeout(ctx context.Context) (time.Duration, error)
}

type ServerOperator added in v0.1.11

type ServerOperator interface {
	http.Handler
	ServerRunner
	ServerInfo
}

type ServerRunner added in v0.1.11

type ServerRunner interface {
	Run(ctx context.Context) error
	Shutdown(ctx context.Context) error
	WithNotFoundHandler(ctx context.Context, x HandlerFunc) error
}

type ServiceAccountFile added in v0.1.479

type ServiceAccountFile struct {
	PrivateKey  string `json:"private_key"`
	ClientEmail string `json:"client_email"`
}

type Signed added in v0.1.830

type Signed interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64 | ~float32 | ~float64
}

Signed is any numeric type that can be negative.

type SortDirection added in v0.0.5

type SortDirection int

SortDirection represents the sorting order for MongoDB queries.

type SortStripeBalanceOption added in v0.1.843

type SortStripeBalanceOption = Opt[SortStripeBalanceOptions]

func WithSortStripeBalanceB added in v0.1.843

func WithSortStripeBalanceB(x stripeApi.Balance) SortStripeBalanceOption

type SortStripeBalanceOptions added in v0.1.843

type SortStripeBalanceOptions struct {
	B stripeApi.Balance
}

func ApplySortStripeBalanceOptions added in v0.1.843

func ApplySortStripeBalanceOptions(opts *SortStripeBalanceOptions, modifiers ...SortStripeBalanceOption) SortStripeBalanceOptions

func (*SortStripeBalanceOptions) Validate added in v0.1.843

func (o *SortStripeBalanceOptions) Validate() error

type SortStripeBalanceResult added in v0.1.843

type SortStripeBalanceResult struct {
	Available        []StripeBalanceDetails `json:"available"`
	Pending          []StripeBalanceDetails `json:"pending"`
	InstantAvailable []StripeBalanceDetails `json:"instant_available"`
}

func NewSortStripeBalanceResult added in v0.1.843

func NewSortStripeBalanceResult(opts ...SortStripeBalanceResultOption) *SortStripeBalanceResult

type SortStripeBalanceResultOption added in v0.1.843

type SortStripeBalanceResultOption = Opt[SortStripeBalanceResult]

func WithSortStripeBalanceResultAvailable added in v0.1.843

func WithSortStripeBalanceResultAvailable(x []StripeBalanceDetails) SortStripeBalanceResultOption

func WithSortStripeBalanceResultInstantAvailable added in v0.1.843

func WithSortStripeBalanceResultInstantAvailable(x []StripeBalanceDetails) SortStripeBalanceResultOption

func WithSortStripeBalanceResultPending added in v0.1.843

func WithSortStripeBalanceResultPending(x []StripeBalanceDetails) SortStripeBalanceResultOption

type Sortable added in v0.1.62

type Sortable interface {
	SortBy() string
}

type SpeechClient added in v0.1.458

type SpeechClient interface {
	Recognize(ctx context.Context, req *speechpb.RecognizeRequest, opts ...gax.CallOption) (*speechpb.RecognizeResponse, error)
	Close() error
}

type SpeechOperator added in v0.1.458

type SpeechOperator interface {
	Recognize(ctx context.Context, opts SpeechRecognizeOptions) (*SpeechToTextResponse, error)
	GetMatcher(ctx context.Context) (language.Matcher, error)
	CloserWithCtx
}

type SpeechRecognizeOption added in v0.1.458

type SpeechRecognizeOption = Opt[SpeechRecognizeOptions]

func WithSpeechModel added in v0.1.458

func WithSpeechModel(x string) SpeechRecognizeOption

func WithSpeechRecognizeAudioLanguageCode added in v0.1.458

func WithSpeechRecognizeAudioLanguageCode(x string) SpeechRecognizeOption

func WithSpeechRecognizeFileURI added in v0.1.458

func WithSpeechRecognizeFileURI(x string) SpeechRecognizeOption

func WithSpeechRecognizeMaxAlternatives added in v0.1.458

func WithSpeechRecognizeMaxAlternatives(x int32) SpeechRecognizeOption

func WithSpeechRecognizeRecognizerName added in v0.1.458

func WithSpeechRecognizeRecognizerName(x string) SpeechRecognizeOption

func WithSpeechRecognizeRelevanceThreshold added in v0.1.458

func WithSpeechRecognizeRelevanceThreshold(x float32) SpeechRecognizeOption

type SpeechRecognizeOptions added in v0.1.458

type SpeechRecognizeOptions struct {
	// The URI of the file to be recognized.
	FileURI string
	// The BCP-47 language code of the audio.
	AudioLanguageCode string
	// The maximum number of recognition alternatives to be returned.
	MaxAlternatives int32
	// The confidence threshold for filtering alternatives.
	RelevanceThreshold float32
	// The recognizer name (e.g., for specific model variants).
	RecognizerName string
	// The Google Speech-to-Text model to use.
	SpeechModel string
}

func ApplySpeechRecognizeOptions added in v0.1.458

func ApplySpeechRecognizeOptions(opts *SpeechRecognizeOptions, modifiers ...SpeechRecognizeOption) SpeechRecognizeOptions

func (*SpeechRecognizeOptions) ToRecognizerFQDN added in v0.1.603

func (o *SpeechRecognizeOptions) ToRecognizerFQDN(projectID string) FQDN

ToRecognizerFQDN constructs the fully-qualified recognizer path for the Speech-to-Text API.

func (SpeechRecognizeOptions) ToSpeechpbConfig added in v0.1.458

func (o SpeechRecognizeOptions) ToSpeechpbConfig() *speechpb.RecognitionConfig

ToSpeechpbConfig converts the SpeechRecognizeOptions to a speechpb.RecognitionConfig.

func (SpeechRecognizeOptions) Validate added in v0.1.458

func (o SpeechRecognizeOptions) Validate() error

type SpeechToTextResponse added in v0.1.458

type SpeechToTextResponse struct {
	Transcriptions []SpeechToTextTranscription `json:"transcriptions"`
	Problem        bool                        `json:"problem"`
}

SpeechToTextResponse represents the structured output of a speech-to-text operation.

func NewSpeechToTextResponse added in v0.1.458

func NewSpeechToTextResponse(opts ...SpeechToTextResponseOption) *SpeechToTextResponse

type SpeechToTextResponseOption added in v0.1.458

type SpeechToTextResponseOption func(*SpeechToTextResponse)

func WithProblem added in v0.1.458

func WithProblem(x bool) SpeechToTextResponseOption

func WithTranscriptions added in v0.1.458

type SpeechToTextTranscription added in v0.1.458

type SpeechToTextTranscription struct {
	Text       string  `json:"text"`
	Confidence float32 `json:"confidence"`
}

SpeechToTextTranscription holds a single transcription and its confidence score.

type Status added in v0.1.699

type Status = string

type StorageOperator added in v0.1.595

type StorageOperator interface {
	Upload(ctx context.Context, opts UploadOptions) error
}

type StoreOption added in v0.1.498

type StoreOption = Opt[StoreOptions]

func WithStoreBaseURL added in v0.1.498

func WithStoreBaseURL(x *url.URL) StoreOption

func WithStoreBody added in v0.1.498

func WithStoreBody(x io.Reader) StoreOption

func WithStoreExpectedStatus added in v0.1.498

func WithStoreExpectedStatus(x int) StoreOption

func WithStoreFormDataContentType added in v0.1.498

func WithStoreFormDataContentType(x string) StoreOption

func WithStoreForwardHeaders added in v0.1.498

func WithStoreForwardHeaders(x ...string) StoreOption

func WithStoreQueryParams added in v0.1.498

func WithStoreQueryParams(x url.Values) StoreOption

type StoreOptions added in v0.1.498

type StoreOptions struct {
	BaseURL             *url.URL
	QueryParams         url.Values
	Body                io.Reader
	ForwardHeaders      []string
	FormDataContentType string
	ExpectedStatus      int
}

func ApplyStoreOptions added in v0.1.498

func ApplyStoreOptions(opts *StoreOptions, modifiers ...StoreOption) StoreOptions

func (*StoreOptions) Validate added in v0.1.498

func (s *StoreOptions) Validate() error

type StringOperator added in v0.1.336

type StringOperator interface {
	Generator
	Normalizer
	Conformer
	Parser
}

type StripeAccount added in v0.1.843

type StripeAccount interface {
	Create(ctx context.Context, params *stripeApi.AccountCreateParams) (*stripeApi.Account, error)
	Delete(ctx context.Context, id string, params *stripeApi.AccountDeleteParams) (*stripeApi.Account, error)
}
type StripeAccountLink interface {
	Create(ctx context.Context, params *stripeApi.AccountLinkCreateParams) (*stripeApi.AccountLink, error)
}

type StripeBalance added in v0.1.843

type StripeBalance interface {
	Retrieve(ctx context.Context, params *stripeApi.BalanceRetrieveParams) (*stripeApi.Balance, error)
}

type StripeBalanceDetails added in v0.1.843

type StripeBalanceDetails struct {
	Currency string `json:"currency"`
	Balance  int64  `json:"balance"`
}

type StripeBalanceOption added in v0.1.843

type StripeBalanceOption = Opt[StripeBalanceOptions]

func WithStripeBalanceConnectedAccountID added in v0.1.845

func WithStripeBalanceConnectedAccountID(x *ID) StripeBalanceOption

type StripeBalanceOptions added in v0.1.843

type StripeBalanceOptions struct {
	StripeConnectedAccountID
}

func ApplyStripeBalanceOptions added in v0.1.843

func ApplyStripeBalanceOptions(opts *StripeBalanceOptions, modifiers ...StripeBalanceOption) StripeBalanceOptions

func (*StripeBalanceOptions) Params added in v0.1.845

func (*StripeBalanceOptions) Validate added in v0.1.843

func (o *StripeBalanceOptions) Validate() error

type StripeBankAccount added in v0.1.843

type StripeBypass added in v0.1.843

type StripeBypass struct {
	Bypass bool
}

type StripeClient added in v0.1.845

func (*StripeClient) Validate added in v0.1.845

func (c *StripeClient) Validate() error

type StripeConnectedAccountID added in v0.1.845

type StripeConnectedAccountID struct {
	ConnectedAccountID *ID
}

func (*StripeConnectedAccountID) Validate added in v0.1.845

func (o *StripeConnectedAccountID) Validate() error

type StripeMetadataKey added in v0.1.845

type StripeMetadataKey = string

type StripeOperator added in v0.1.843

type StripeOperator interface {
	StripeSpecialized
}

type StripePaymentIntent added in v0.1.843

type StripePaymentIntentOption added in v0.1.843

type StripePaymentIntentOption = Opt[StripePaymentIntentOptions]

func WithStripePaymentIntentConnectedAccountID added in v0.1.845

func WithStripePaymentIntentConnectedAccountID(x *ID) StripePaymentIntentOption

func WithStripePaymentIntentPaymentIntentID added in v0.1.843

func WithStripePaymentIntentPaymentIntentID(x *ID) StripePaymentIntentOption

type StripePaymentIntentOptions added in v0.1.843

type StripePaymentIntentOptions struct {
	StripeConnectedAccountID
	PaymentIntentID *ID
}

func ApplyStripePaymentIntentOptions added in v0.1.843

func ApplyStripePaymentIntentOptions(opts *StripePaymentIntentOptions, modifiers ...StripePaymentIntentOption) StripePaymentIntentOptions

func (*StripePaymentIntentOptions) Params added in v0.1.845

func (*StripePaymentIntentOptions) Validate added in v0.1.843

func (o *StripePaymentIntentOptions) Validate() error

type StripePaymentMethod added in v0.1.843

type StripePaymentMethod interface {
	Retrieve(ctx context.Context, id string, params *stripeApi.PaymentMethodRetrieveParams) (*stripeApi.PaymentMethod, error)
	Create(ctx context.Context, params *stripeApi.PaymentMethodCreateParams) (*stripeApi.PaymentMethod, error)
}

type StripePaymentMethodOption added in v0.1.843

type StripePaymentMethodOption = Opt[StripePaymentMethodOptions]

func WithStripePaymentMethodConnectedAccountID added in v0.1.845

func WithStripePaymentMethodConnectedAccountID(x *ID) StripePaymentMethodOption

func WithStripePaymentMethodPaymentMethodID added in v0.1.843

func WithStripePaymentMethodPaymentMethodID(x *ID) StripePaymentMethodOption

type StripePaymentMethodOptions added in v0.1.843

type StripePaymentMethodOptions struct {
	StripeConnectedAccountID
	PaymentMethodID *ID
}

func ApplyStripePaymentMethodOptions added in v0.1.843

func ApplyStripePaymentMethodOptions(opts *StripePaymentMethodOptions, modifiers ...StripePaymentMethodOption) StripePaymentMethodOptions

func (*StripePaymentMethodOptions) Params added in v0.1.845

func (*StripePaymentMethodOptions) Validate added in v0.1.843

func (o *StripePaymentMethodOptions) Validate() error

type StripeRefund added in v0.1.843

type StripeRefund interface {
	Create(ctx context.Context, params *stripeApi.RefundCreateParams) (*stripeApi.Refund, error)
}

type StripeSetupIntent added in v0.1.843

type StripeSetupIntent interface {
	Create(ctx context.Context, params *stripeApi.SetupIntentCreateParams) (*stripeApi.SetupIntent, error)
	Confirm(ctx context.Context, id string, params *stripeApi.SetupIntentConfirmParams) (*stripeApi.SetupIntent, error)
}

type StripeSpecialized added in v0.1.843

type StripeSpecialized interface {
	OpenStripeAccount(ctx context.Context, opts OpenStripeAccountOptions) (*stripeApi.Account, error)
	DeleteStripeAccount(ctx context.Context, opts DeleteStripeAccountOptions) (*stripeApi.Account, error)
	CreateStripeAccountLink(ctx context.Context, opts CreateStripeAccountLinkOptions) (*stripeApi.AccountLink, error)
	StripePaymentIntent(ctx context.Context, opts StripePaymentIntentOptions) (*stripeApi.PaymentIntent, error)
	OpenStripePayment(ctx context.Context, opts OpenStripePaymentOptions) (*stripeApi.PaymentIntent, error)
	ConfirmStripePayment(ctx context.Context, opts ConfirmStripePaymentOptions) (*stripeApi.PaymentIntent, error)
	RefundStripePayment(ctx context.Context, opts RefundStripePaymentOptions) (*stripeApi.Refund, error)
	StripePaymentMethod(ctx context.Context, opts StripePaymentMethodOptions) (*stripeApi.PaymentMethod, error)
	AddStripeCard(ctx context.Context, opts AddStripeCardOptions) (*stripeApi.PaymentMethod, error)
	VerifyStripeCard(ctx context.Context, opts VerifyStripeCardOptions) (*stripeApi.SetupIntent, error)
	ConfirmStripeSetupIntent(ctx context.Context, opts ConfirmStripeSetupIntentOptions) (*stripeApi.SetupIntent, error)
	LinkStripeBankAccount(ctx context.Context, opts LinkStripeBankAccountOptions) (*stripeApi.BankAccount, error)
	UpdateStripeBankAccount(ctx context.Context, opts UpdateStripeBankAccountOptions) (*stripeApi.BankAccount, error)
	DeleteStripeBankAccount(ctx context.Context, opts DeleteStripeBankAccountOptions) error
	StripeBalance(ctx context.Context, opts StripeBalanceOptions) (*stripeApi.Balance, error)
	SortStripeBalance(ctx context.Context, opts SortStripeBalanceOptions) (*SortStripeBalanceResult, error)
	DecodeStripeEvent(ctx context.Context, opts DecodeStripeEventOptions) (*stripeApi.Event, error)
	DecodeStripeEventData(ctx context.Context, opts DecodeStripeEventDataOptions) error
	ExtractNextActionURL(ctx context.Context, v any) (string, error)
}

type Sysbox added in v0.1.884

type Sysbox struct {
	Local   fs.ReadFileFS
	Private fs.ReadFileFS
}

func (*Sysbox) Validate added in v0.1.884

func (s *Sysbox) Validate() error

type SysboxPath added in v0.1.885

type SysboxPath = string

func SysboxPathFn added in v0.1.885

func SysboxPathFn(parts ...string) SysboxPath

type TemplateOperator added in v0.1.385

type TemplateOperator interface {
	TemplateRenderer
}

type TemplateRenderer added in v0.1.385

type TemplateRenderer interface {
	Render(ctx context.Context, opts RenderOptions) error
}

type TextOptions added in v0.0.5

type TextOptions struct {
	Query  string
	Fields []string
}

type Tool

type Tool[C any] struct {
	Client C
	Logger LogOperator
}

func NewTool

func NewTool[C any](client C, opts ToolOptions[C]) *Tool[C]

type ToolOption

type ToolOption[C any] = Opt[ToolOptions[C]]

func WithLogger

func WithLogger[C any](x LogOperator) ToolOption[C]

type ToolOptions

type ToolOptions[C any] struct {
	Logger LogOperator
}

func ApplyToolOptions added in v0.1.12

func ApplyToolOptions[C any](opts *ToolOptions[C], modifiers ...ToolOption[C]) ToolOptions[C]

type TranslateClient added in v0.1.384

type TranslateClient interface {
	Translate(ctx context.Context, inputs []string, target language.Tag, opts *translate.Options) ([]translate.Translation, error)
	SupportedLanguages(ctx context.Context, target language.Tag) ([]translate.Language, error)
	Close() error
}

type TranslateCommonOption added in v0.1.393

type TranslateCommonOption func(*TranslateCommonOptions)

func WithBaseOnly added in v0.1.393

func WithBaseOnly(x bool) TranslateCommonOption

func WithSourceTag added in v0.1.393

func WithSourceTag(x language.Tag) TranslateCommonOption

func WithTargetTag added in v0.1.393

func WithTargetTag(x language.Tag) TranslateCommonOption

type TranslateCommonOptions added in v0.1.384

type TranslateCommonOptions struct {
	SourceTag language.Tag
	Target    language.Tag
	BaseOnly  bool
}

type TranslateHTMLOption added in v0.1.393

type TranslateHTMLOption = Opt[TranslateHTMLOptions]

func WithHTMLReader added in v0.1.393

func WithHTMLReader(x io.Reader) TranslateHTMLOption

func WithHTMLSelector added in v0.1.393

func WithHTMLSelector(x string) TranslateHTMLOption

type TranslateHTMLOptions added in v0.1.384

type TranslateHTMLOptions struct {
	TranslateCommonOptions
	R        io.Reader
	Selector string
}

func ApplyTranslateHTMLOptions added in v0.1.393

func ApplyTranslateHTMLOptions(base *TranslateHTMLOptions, htmlModifiers []TranslateHTMLOption, commonModifiers ...TranslateCommonOption) TranslateHTMLOptions

type TranslateTextOption added in v0.1.393

type TranslateTextOption = Opt[TranslateTextOptions]

func WithConvertLineBreaks added in v0.1.393

func WithConvertLineBreaks(x bool) TranslateTextOption

func WithText added in v0.1.393

func WithText(x string) TranslateTextOption

func WithTranslateOpts added in v0.1.393

func WithTranslateOpts(x *translate.Options) TranslateTextOption

type TranslateTextOptions added in v0.1.384

type TranslateTextOptions struct {
	TranslateCommonOptions
	Text              string
	ConvertLineBreaks bool
	Opts              *translate.Options
}

func ApplyTranslateTextOptions added in v0.1.393

func ApplyTranslateTextOptions(base *TranslateTextOptions, textModifiers []TranslateTextOption, commonModifiers ...TranslateCommonOption) TranslateTextOptions

type TranslationOperator added in v0.1.384

type TranslationOperator interface {
	TranslateText(ctx context.Context, opts TranslateTextOptions) (string, error)
	TranslateHTML(ctx context.Context, opts TranslateHTMLOptions) (io.Reader, error)
	ParseLanguage(ctx context.Context, BCP47Code string) (*language.Tag, error)
	SuggestBestMatch(ctx context.Context, userLanguage, fallback language.Tag, matcher ...language.Matcher) (*language.Tag, error)
	CloserWithCtx
}

type TwilioAPIService added in v0.1.364

type TwilioAPIService interface {
	CreateMessage(params *twilioApi.CreateMessageParams) (*twilioApi.ApiV2010Message, error)
}

type TwilioDecoder added in v0.1.796

type TwilioDecoder interface {
	DecodeCallback(ctx context.Context, opts DecodeCallbackOptions) (*TwilioEvent, error)
}

type TwilioEvent added in v0.1.796

type TwilioEvent struct {
	Timestamp *time.Time `json:"timestamp" validate:"nnpt"`
	Event     *CallEvent `json:"event" validate:"nnpt,nz"`
	RoomSID   *ID        `json:"room_sid" validate:"nnpt"`
	RoomID    *ID        `json:"room_id" validate:"nnpt"`
	UserSID   *ID        `json:"user_sid" validate:"nnpt"`
	UserID    *ID        `json:"user_id" validate:"nnpt"`
}

func NewTwilioEvent added in v0.1.796

func NewTwilioEvent(opts ...TwilioEventOption) *TwilioEvent

func (*TwilioEvent) GetEvent added in v0.1.796

func (e *TwilioEvent) GetEvent() CallEvent

func (*TwilioEvent) GetRoomID added in v0.1.796

func (e *TwilioEvent) GetRoomID() ID

func (*TwilioEvent) GetRoomSID added in v0.1.796

func (e *TwilioEvent) GetRoomSID() ID

func (*TwilioEvent) GetTimestamp added in v0.1.796

func (e *TwilioEvent) GetTimestamp() time.Time

func (*TwilioEvent) GetUserID added in v0.1.796

func (e *TwilioEvent) GetUserID() ID

func (*TwilioEvent) GetUserSID added in v0.1.796

func (e *TwilioEvent) GetUserSID() ID

func (*TwilioEvent) SetEvent added in v0.1.796

func (e *TwilioEvent) SetEvent(x CallEvent)

func (*TwilioEvent) SetRoomID added in v0.1.796

func (e *TwilioEvent) SetRoomID(x ID)

func (*TwilioEvent) SetRoomSID added in v0.1.796

func (e *TwilioEvent) SetRoomSID(x ID)

func (*TwilioEvent) SetTimestamp added in v0.1.796

func (e *TwilioEvent) SetTimestamp(x time.Time)

func (*TwilioEvent) SetUserID added in v0.1.796

func (e *TwilioEvent) SetUserID(x ID)

func (*TwilioEvent) SetUserSID added in v0.1.796

func (e *TwilioEvent) SetUserSID(x ID)

type TwilioEventOption added in v0.1.796

type TwilioEventOption = Opt[TwilioEvent]

func WithTwilioEventEvent added in v0.1.796

func WithTwilioEventEvent(x CallEvent) TwilioEventOption

func WithTwilioEventRoomID added in v0.1.796

func WithTwilioEventRoomID(x ID) TwilioEventOption

func WithTwilioEventRoomSID added in v0.1.796

func WithTwilioEventRoomSID(x ID) TwilioEventOption

func WithTwilioEventTimestamp added in v0.1.796

func WithTwilioEventTimestamp(x time.Time) TwilioEventOption

func WithTwilioEventUserID added in v0.1.796

func WithTwilioEventUserID(x ID) TwilioEventOption

func WithTwilioEventUserSID added in v0.1.796

func WithTwilioEventUserSID(x ID) TwilioEventOption

type TwilioOperator added in v0.1.364

type TwilioOperator interface {
	SMS
	TwilioTokenMinter
	TwilioDecoder
}

type TwilioTokenMinter added in v0.1.796

type TwilioTokenMinter interface {
	MintVideoToken(ctx context.Context, opts MintVideoTokenOptions) (*string, error)
}

type UnionWithField added in v0.1.750

type UnionWithField = string

UnionWithField represents the field used for unions in MongoDB Atlas.

type Unmarshaler

type Unmarshaler interface {
	Unmarshal(ctx context.Context, data io.Reader, v any, opts JSONOptions) error
}

type UpdateStripeBankAccountOption added in v0.1.843

type UpdateStripeBankAccountOption = Opt[UpdateStripeBankAccountOptions]

func WithUpdateStripeBankAccountBankAccountID added in v0.1.843

func WithUpdateStripeBankAccountBankAccountID(x *ID) UpdateStripeBankAccountOption

func WithUpdateStripeBankAccountConnectedAccountID added in v0.1.845

func WithUpdateStripeBankAccountConnectedAccountID(x *ID) UpdateStripeBankAccountOption

func WithUpdateStripeBankAccountDefaultForCurrency added in v0.1.921

func WithUpdateStripeBankAccountDefaultForCurrency(x bool) UpdateStripeBankAccountOption

type UpdateStripeBankAccountOptions added in v0.1.843

type UpdateStripeBankAccountOptions struct {
	StripeConnectedAccountID
	BankAccountID      *ID
	DefaultForCurrency bool
}

func ApplyUpdateStripeBankAccountOptions added in v0.1.843

func ApplyUpdateStripeBankAccountOptions(opts *UpdateStripeBankAccountOptions, modifiers ...UpdateStripeBankAccountOption) UpdateStripeBankAccountOptions

func (*UpdateStripeBankAccountOptions) Params added in v0.1.845

func (*UpdateStripeBankAccountOptions) Validate added in v0.1.843

func (o *UpdateStripeBankAccountOptions) Validate() error

type UploadObjectOption added in v0.1.479

type UploadObjectOption = Opt[UploadObjectOptions]

func WithUploadObjectBucketName added in v0.1.479

func WithUploadObjectBucketName(x string) UploadObjectOption

func WithUploadObjectFile added in v0.1.479

func WithUploadObjectFile(x *BucketFile) UploadObjectOption

type UploadObjectOptions added in v0.1.479

type UploadObjectOptions struct {
	BucketName string
	F          *BucketFile
}

func ApplyUploadObjectOptions added in v0.1.479

func ApplyUploadObjectOptions(opts *UploadObjectOptions, modifiers ...UploadObjectOption) UploadObjectOptions

func (*UploadObjectOptions) Validate added in v0.1.479

func (o *UploadObjectOptions) Validate() error

type UploadObjectsOption added in v0.1.479

type UploadObjectsOption = Opt[UploadObjectsOptions]

func WithUploadObjectsBucketName added in v0.1.479

func WithUploadObjectsBucketName(x string) UploadObjectsOption

func WithUploadObjectsFiles added in v0.1.479

func WithUploadObjectsFiles(x []*BucketFile) UploadObjectsOption

type UploadObjectsOptions added in v0.1.479

type UploadObjectsOptions struct {
	BucketName string
	F          []*BucketFile
}

func ApplyUploadObjectsOptions added in v0.1.479

func ApplyUploadObjectsOptions(opts *UploadObjectsOptions, modifiers ...UploadObjectsOption) UploadObjectsOptions

func (*UploadObjectsOptions) Validate added in v0.1.479

func (o *UploadObjectsOptions) Validate() error

type UploadOption added in v0.1.595

type UploadOption = Opt[UploadOptions]

func WithUploadCollection added in v0.1.595

func WithUploadCollection(x string) UploadOption

func WithUploadFiles added in v0.1.595

func WithUploadFiles(x []MultipartFile) UploadOption

func WithUploadFullQuality added in v0.1.595

func WithUploadFullQuality(x bool) UploadOption

func WithUploadOwnerID added in v0.1.595

func WithUploadOwnerID(x *ID) UploadOption

func WithUploadRequest added in v0.1.595

func WithUploadRequest(x *http.Request) UploadOption

func WithUploadUploaderID added in v0.1.595

func WithUploadUploaderID(x *ID) UploadOption

type UploadOptions added in v0.1.595

type UploadOptions struct {
	OwnerID     *ID
	UploaderID  *ID
	FullQuality bool
	Collection  string
	R           *http.Request
	Files       []MultipartFile
}

func ApplyUploadOptions added in v0.1.595

func ApplyUploadOptions(opts *UploadOptions, modifiers ...UploadOption) UploadOptions

func (*UploadOptions) Validate added in v0.1.595

func (o *UploadOptions) Validate() error

type UpsertOneHandlerOptions added in v0.1.584

type UpsertOneHandlerOptions struct {
	Atz
	Bypass
	InjectQuery map[string][]string
	InsertOnly  bool
}

type UpsertResult added in v0.1.584

type UpsertResult struct {
	ID       *ID  `json:"id,omitempty"`
	Inserted bool `json:"inserted,omitempty"`
}

UpsertResult represents the response of an upsert operation.

func NewUpsertResult added in v0.1.584

func NewUpsertResult(opts ...UpsertResultOption) *UpsertResult

type UpsertResultOption added in v0.1.584

type UpsertResultOption = Opt[UpsertResult]

func WithUpsertID added in v0.1.584

func WithUpsertID(x *ID) UpsertResultOption

func WithUpsertInserted added in v0.1.584

func WithUpsertInserted(x bool) UpsertResultOption

type UserType added in v0.1.699

type UserType string

func (UserType) String added in v0.1.699

func (u UserType) String() string

func (*UserType) Validate added in v0.1.699

func (u *UserType) Validate() error

type ValidationOperator added in v0.1.338

type ValidationOperator interface {
	Validate(ctx context.Context, k string, v any) error
	RunGuards(ctx context.Context, opts RunGuardsOptions) error
}

type VectorSearchField added in v0.0.5

type VectorSearchField = string

VectorSearchField represents the field used for vector search in MongoDB Atlas.

type VerifyStripeCardOption added in v0.1.843

type VerifyStripeCardOption = Opt[VerifyStripeCardOptions]

func WithVerifyStripeCardConnectedAccountID added in v0.1.845

func WithVerifyStripeCardConnectedAccountID(x *ID) VerifyStripeCardOption

func WithVerifyStripeCardPaymentMethodID added in v0.1.843

func WithVerifyStripeCardPaymentMethodID(x *ID) VerifyStripeCardOption

type VerifyStripeCardOptions added in v0.1.843

type VerifyStripeCardOptions struct {
	StripeConnectedAccountID
	PaymentMethodID *ID
}

func ApplyVerifyStripeCardOptions added in v0.1.843

func ApplyVerifyStripeCardOptions(opts *VerifyStripeCardOptions, modifiers ...VerifyStripeCardOption) VerifyStripeCardOptions

func (*VerifyStripeCardOptions) Params added in v0.1.845

func (*VerifyStripeCardOptions) Validate added in v0.1.843

func (o *VerifyStripeCardOptions) Validate() error

type VertexEmbedder added in v0.1.668

type VertexEmbedder interface {
	EmbedderOperator
	GetEmbeddings(ctx context.Context, in []EmbedInput) (*EmbedR, error)
}

type VertexGenerativeModels added in v0.1.756

type VertexGenerativeModels interface {
	GenerateContent(ctx context.Context, model string, contents []*genai.Content, config *genai.GenerateContentConfig) (*genai.GenerateContentResponse, error)
}

type VertexModels added in v0.1.661

type VertexModels interface {
	EmbedContent(ctx context.Context, model string, contents []*genai.Content, config *genai.EmbedContentConfig) (*genai.EmbedContentResponse, error)
}

type VertexOperator added in v0.1.661

type VertexOperator interface {
	VertexEmbedder
	Captioner
}

type VideoCodec added in v0.1.498

type VideoCodec struct {
	Name     string
	MinValue uint32
	MaxValue uint32
}

type VideoIntelOperator added in v0.1.477

type VideoIntelOperator interface {
	IntelOperator
}

type Visibility added in v0.1.409

type Visibility uint
const (
	Private Visibility = iota
	Contacts
	All
)

func (Visibility) Validate added in v0.1.411

func (v Visibility) Validate() error

type WatchCollectionOptions added in v0.0.5

type WatchCollectionOptions struct {
	Collection string
	Receiver   any
	Pipeline   MongoPipeliner
	Options    *options.ChangeStreamOptionsBuilder
	LookupKey  string
	Output     MongoOutCSChan
}

type WatchDBOptions added in v0.0.5

type WatchDBOptions struct {
	Receiver  any
	Pipeline  MongoPipeliner
	Options   *options.ChangeStreamOptionsBuilder
	LookupKey string
	Output    MongoOutCSChan
}

type WorksiteType added in v0.1.699

type WorksiteType = string

type WrapperWriteCloser added in v0.1.594

type WrapperWriteCloser interface {
	WrapWriteCloser(ctx context.Context, w io.Writer) (io.WriteCloser, error)
}

type Writer added in v0.1.381

type Writer interface {
	Write(ctx context.Context, w io.Writer, data []byte) error
}

Jump to

Keyboard shortcuts

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