configuration

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MONGO = "mongo"
	FILE  = "file"
)

Variables

This section is empty.

Functions

func GetMongoDriver added in v1.4.0

func GetMongoDriver(driverFromConf string) string

GetMongoDriver returns a valid mongo driver to use, it receives the driver set in config, and check its validity otherwise default to mongo-go

func LoadConfig

func LoadConfig(filePath string, conf *Configuration)

LoadConfig will load the config from a file

Types

type Backend

type Backend struct {
	ProfileBackendSettings  interface{}
	IdentityBackendSettings IdentityBackendSettings
}

type Configuration

type Configuration struct {
	Secret            string
	Port              int
	ProfileDir        string
	BackEnd           Backend
	TykAPISettings    tyk.TykAPI
	HttpServerOptions struct {
		UseSSL                bool
		CertFile              string
		KeyFile               string
		SSLInsecureSkipVerify bool
	}
	SSLInsecureSkipVerify bool
	Storage               *Storage
}

Configuration holds all configuration settings for TAP

type FileLoaderConf

type FileLoaderConf struct {
	FileName   string
	ProfileDir string
}

FileLoaderConf is the configuration struct for a FileLoader, takes a filename as main init

type IdentityBackendSettings

type IdentityBackendSettings struct {
	Database              int
	Username              string
	Password              string
	Host                  string
	Port                  int
	Timeout               int
	MaxIdle               int
	MaxActive             int
	UseSSL                bool
	SSLInsecureSkipVerify bool
	CAFile                string
	CertFile              string
	KeyFile               string
	MaxVersion            string
	MinVersion            string
	EnableCluster         bool
	Addrs                 []string
	Hosts                 map[string]string // Deprecated: Use Addrs instead.
	MasterName            string
	SentinelPassword      string
}

type MongoConf

type MongoConf struct {
	DbName                     string `json:"db_name" mapstructure:"db_name"`
	MongoURL                   string `json:"mongo_url" mapstructure:"mongo_url"`
	MongoUseSSL                bool   `json:"mongo_use_ssl" mapstructure:"mongo_use_ssl"`
	MongoSSLInsecureSkipVerify bool   `json:"mongo_ssl_insecure_skip_verify" mapstructure:"mongo_ssl_insecure_skip_verify"`
	MaxInsertBatchSizeBytes    int    `json:"max_insert_batch_size_bytes" mapstructure:"max_insert_batch_size_bytes"`
	MaxDocumentSizeBytes       int    `json:"max_document_size_bytes" mapstructure:"max_document_size_bytes"`
	CollectionCapMaxSizeBytes  int    `json:"collection_cap_max_size_bytes" mapstructure:"collection_cap_max_size_bytes"`
	CollectionCapEnable        bool   `json:"collection_cap_enable" mapstructure:"collection_cap_enable"`
	SessionConsistency         string `json:"session_consistency" mapstructure:"session_consistency"`
	Driver                     string `json:"driver" mapstructure:"driver"`
	DirectConnection           bool   `json:"direct_connection" mapstructure:"direct_connection"`
}

type Storage

type Storage struct {
	StorageType string     `json:"storage_type" mapstructure:"storage_type"`
	MongoConf   *MongoConf `json:"mongo" mapstructure:"mongo"`
}

Storage object to configure the storage where the profiles lives in it can be extended to work with other loaders. As file Loader is the default then we dont read the file path from here

type TLS added in v1.5.0

type TLS struct {
}

Jump to

Keyboard shortcuts

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