Integrations
Steward’s infrastructure needs are expressed as four small interfaces on
Config. Every one has a zero-dependency default; heavier drivers live in
contrib/ as separate modules so your go.mod only pays for what you use.
Cache
type Cache interface {
Get(ctx context.Context, key string) ([]byte, bool, error)
Set(ctx context.Context, key string, val []byte, ttl time.Duration) error
Delete(ctx context.Context, keys ...string) error
}Default: in-process memory cache. Redis driver:
import "github.com/imfiqhan/steward/contrib/redcache"
Cache: redcache.New(redisClient), // any go-redis v9 UniversalClientStorage
Backs File/Image form fields and serves uploads under
{prefix}/_uploads/.
type Storage interface {
Put(ctx context.Context, name string, r io.Reader, size int64, contentType string) (url string, err error)
Delete(ctx context.Context, name string) error
URL(name string) string
}Default: local disk at Config.UploadDir (./uploads). S3-compatible
driver (AWS, MinIO, R2):
import "github.com/imfiqhan/steward/contrib/s3store"
store, err := s3store.New(s3store.Config{
Endpoint: "s3.amazonaws.com",
AccessKey: key, SecretKey: secret,
Bucket: "my-uploads",
UseSSL: true,
})Mailer
Setting a mailer enables the password-reset flow (forgot-password link on the login page, one-hour stateless tokens):
Mailer: &steward.SMTPMailer{
Host: "smtp.example.com", Port: 587,
Username: "...", Password: "...",
From: "Steward <no-reply@example.com>",
},Scheduler
steward.Scheduler runs recurring jobs — deliberately in a separate worker
process rather than inside the panel. See
Runtime commands.
Mounting under a router
The Admin is a plain http.Handler; mount it anywhere. A Gin helper
ships in contrib:
import "github.com/imfiqhan/steward/contrib/ginsteward"
r := gin.Default()
ginsteward.Mount(r, app)