models

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAppSettingsNotAPointer = errors.New("app settings must be a pointer")

Functions

This section is empty.

Types

type AuthProviderConfig

type AuthProviderConfig struct {
	Enabled      bool   `json:"enabled"`
	ClientId     string `json:"clientId"`
	ClientSecret string `json:"clientSecret"`
	AuthUrl      string `json:"authUrl"`
	TokenUrl     string `json:"tokenUrl"`
	DisplayName  string `json:"displayName"`
}

func (AuthProviderConfig) SetupProvider

func (a AuthProviderConfig) SetupProvider(provider auth.Provider) error

type AwsConfig

type AwsConfig struct {
	AccessKeyID     string `yaml:"accessKeyId" json:"accessKeyId"`
	SecretAccessKey string `yaml:"secretAccessKey" json:"secretAccessKey"`
	Region          string `yaml:"region" json:"region"`
	SQS             struct {
		QueueUrl string `yaml:"queueUrl" json:"queueUrl"`
	} `yaml:"sqs" json:"sqs"`
}

type CloudFrontConfig

type CloudFrontConfig struct {
	KeyId              string `yaml:"keyId" json:"keyId"`
	Domain             string `yaml:"domain" json:"domain"`
	PrivateKeyFilePath string `yaml:"privateKeyFilePath" json:"privateKeyFilePath"`
}

type EventBridgeConfig

type EventBridgeConfig struct {
	EventBus string `yaml:"eventBus" json:"eventBus"`
}

type GcloudConfig

type GcloudConfig struct {
	ProjectId        string `yaml:"projectId" json:"projectId"`
	CredfileLocation string `yaml:"credfileLocation" json:"credfileLocation"`

	PubSub struct {
		Topic string `yaml:"topic" json:"topic"`
	} `yaml:"pubsub" json:"pubsub"`
	Storage struct {
		Enabled          bool   `yaml:"enabled" json:"enabled"`
		Bucket           string `yaml:"bucket" json:"bucket"`
		CredfileLocation string `yaml:"credfileLocation" json:"credfileLocation"`
	} `yaml:"storage" json:"storage"`
}

type InMemoryConfig

type InMemoryConfig struct {
	Enabled bool `yaml:"enabled" json:"enabled"`
}

type S3Config

type S3Config struct {
	Bucket  string `yaml:"bucket" json:"bucket"`
	Enabled bool   `yaml:"enabled" json:"enabled"`
}

type Settings

type Settings struct {
	Domain                         string `yaml:"domain" json:"domain"`
	AuthTokenSecret                string `yaml:"authTokenSecret" json:"authTokenSecret"`
	AuthTokenRefreshSecret         string `yaml:"authTokenRefreshSecret" json:"authTokenRefreshSecret"`
	OtpGenerationSecret            string `yaml:"otpGenerationSecret" json:"otpGenerationSecret"`
	OtpPeriod                      uint   `yaml:"otpPeriod" json:"otpPeriod"`
	AuthTokenDuration              int64  `yaml:"authTokenDuration" json:"authTokenDuration"`
	AuthRefreshTokenExpiryDuration int64  `yaml:"authRefreshTokenExpiryDuration" json:"authRefreshTokenExpiryDuration"`

	GoogleAuth   AuthProviderConfig `yaml:"googleAuth" json:"googleAuth"`
	FacebookAuth AuthProviderConfig `yaml:"facebookAuth" json:"facebookAuth"`
	AppleAuth    AuthProviderConfig `yaml:"appleAuth" json:"appleAuth"`

	Aws         AwsConfig         `yaml:"aws" json:"aws"`
	S3          S3Config          `yaml:"s3" json:"s3"`
	CloudFront  CloudFrontConfig  `yaml:"cloudFront" json:"cloudFront"`
	EventBridge EventBridgeConfig `yaml:"eventBridge" json:"eventBridge"`
	InMemory    InMemoryConfig    `yaml:"inMemoryConfig" json:"inMemoryConfig"`
	Glcoud      GcloudConfig      `yaml:"gcloud" json:"gcloud"`

	EventClient types.EventClient `yaml:"eventClient" json:"eventClient"`

	AppSettings any `yaml:"appSettings" json:"appSettings"`
}

func NewSettings

func NewSettings() *Settings

func (*Settings) LoadSettings

func (s *Settings) LoadSettings(settingsFile string, appSettings any) error

func (*Settings) Merge

func (s *Settings) Merge(other *Settings) error

func (*Settings) NamedAuthProviderConfig

func (s *Settings) NamedAuthProviderConfig(providerName string) (AuthProviderConfig, bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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