codefly

package module
v0.1.45 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 8 Imported by: 1

README

workflow Go Report Card Go Reference

codefly + go = sdk-go

Authenticated Postgres capabilities

github.com/codefly-dev/sdk-go/postgres binds Codefly's separate Postgres reader/writer credentials to a verified request principal. The factory keeps raw pools private, installs tenant and user identity with transaction-local settings, starts reads as database-enforced read-only transactions, and asks the application authorizer before issuing a writer. It deliberately exposes no admin or RLS-bypass path.

Application repositories accept postgres.ReadTx or postgres.WriteTx; they do not accept tenant IDs. RLS policies derive tenant scope from codefly.current_tenant_id (or names configured with WithScopeSettings).

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CatchPanic added in v0.0.7

func CatchPanic(ctx context.Context)

func Context added in v0.1.42

func Context() context.Context

Context returns the provider-injected context built by Init (so wool.Get sees the SDK provider), or context.Background() before Init has run.

func GetLogLevel added in v0.0.11

func GetLogLevel() wool.Loglevel

func Init added in v0.0.11

func Init(ctx context.Context) (*wool.Provider, error)

func LoadEnvironmentVariables added in v0.0.7

func LoadEnvironmentVariables() error

func ServiceVersion added in v0.1.39

func ServiceVersion() string

func WithFixture added in v0.1.32

func WithFixture(fixture string) bool

Types

type Query added in v0.1.24

type Query struct {
	// contains filtered or unexported fields
}

func For added in v0.1.24

func For(ctx context.Context) *Query

func (*Query) API added in v0.1.24

func (q *Query) API(name string) *Query

func (*Query) Configuration added in v0.1.24

func (q *Query) Configuration(key string, name string) (string, error)

func (*Query) Endpoint added in v0.1.41

func (q *Query) Endpoint(name string) *Query

Endpoint sets the endpoint name independently from the API type. Use when the endpoint name differs from the API protocol. Example: codefly.For(ctx).Service("neo4j").Endpoint("bolt").API("tcp")

func (*Query) Module added in v0.1.26

func (q *Query) Module(s string) *Query

func (*Query) NetworkInstance added in v0.1.24

func (q *Query) NetworkInstance() *resources.NetworkInstance

func (*Query) Normalize added in v0.1.24

func (q *Query) Normalize()

func (*Query) Secret added in v0.1.24

func (q *Query) Secret(key string, name string) (string, error)

func (*Query) Service added in v0.1.24

func (q *Query) Service(s string) *Query

func (*Query) WithDefaultNetwork added in v0.1.25

func (q *Query) WithDefaultNetwork() *Query

Directories

Path Synopsis
Package scoped provides authenticated, transaction-scoped access to a Codefly Postgres service.
Package scoped provides authenticated, transaction-scoped access to a Codefly Postgres service.

Jump to

Keyboard shortcuts

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