mirror of
https://github.com/syumai/workers.git
synced 2025-03-10 17:29:11 +00:00
F: add incoming property pkg
This commit is contained in:
parent
cdd8a26c53
commit
bb2644d33f
18
cloudflare/incoming/property.go
Normal file
18
cloudflare/incoming/property.go
Normal file
@ -0,0 +1,18 @@
|
||||
package incoming
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/syumai/workers/internal/cfcontext"
|
||||
)
|
||||
|
||||
type Properties struct {
|
||||
AsOrganization string
|
||||
}
|
||||
|
||||
func NewProperties(ctx context.Context) *Properties {
|
||||
obj := cfcontext.MustExtractIncomingProperty(ctx)
|
||||
return &Properties{
|
||||
AsOrganization: obj.Get("asOrganization").String(),
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user