Documentation
¶
Index ¶
- func AddMembers[T Set](ctx context.Context, obj T, members ...string) error
- func AddScoredMember[T SortedSet](ctx context.Context, obj T, score float64, member string) error
- func BOMAwareCSVReader(reader io.Reader) *csv.Reader
- func DeleteStorage[T Storable](ctx context.Context, obj T) error
- func DumpObjectsToPath(what ObjectMap, where string) error
- func DumpObjectsToStream(stream io.Writer, what ObjectMap)
- func FetchMembers[T Set](ctx context.Context, obj T) ([]string, error)
- func FetchOneBlocking[T List](ctx context.Context, obj T, timeout time.Duration) (string, error)
- func FetchRange[T List](ctx context.Context, obj T, start int64, end int64) ([]string, error)
- func FetchRangeInterval[T SortedSet](ctx context.Context, obj T, start, end int64) ([]string, error)
- func FetchRangeScoreInterval[T SortedSet](ctx context.Context, obj T, min, max float64) ([]string, error)
- func FetchString[T String](ctx context.Context, obj T) (string, error)
- func FindEnvFile(name string, fallback bool) (string, error)
- func GetDb() (*redis.Client, string)
- func LoadFields[T StructPointer](ctx context.Context, obj T) error
- func MapFields[T StructPointer](ctx context.Context, f func(), obj T) error
- func PopConfig()
- func PushAlteredConfig(env Environment)
- func PushConfig(name string) error
- func PushRange[T List](ctx context.Context, obj T, onLeft bool, members ...string) error
- func RemoveElement[T List](ctx context.Context, obj T, count int64, element string) error
- func RemoveMember[T SortedSet](ctx context.Context, obj T, member string) error
- func RemoveMembers[T Set](ctx context.Context, obj T, members ...string) error
- func S3GetBlob(ctx context.Context, blobname string, blobfile *os.File) error
- func S3PutBlob(ctx context.Context, blobname string, blobfile *os.File) error
- func SaveFields[T StructPointer](ctx context.Context, obj T) error
- func StoreString[T String](ctx context.Context, obj T, val string) error
- type Environment
- type List
- type ObjectMap
- type Set
- type SortedSet
- type Storable
- type String
- type StructPointer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddScoredMember ¶
func BOMAwareCSVReader ¶
BOMAwareCSVReader will detect a UTF BOM (Byte Order Mark) at the start of the data and transform to UTF8 accordingly. If there is no BOM, it will read the data without any transformation.
This code taken from [this StackOverflow answer](https://stackoverflow.com/a/76023436/558006).
func DumpObjectsToPath ¶
DumpObjectsToPath serializes the entire map to the given filepath
func DumpObjectsToStream ¶
DumpObjectsToStream marshals the objects as JSON to the given stream
func FetchOneBlocking ¶
func FetchRange ¶
func FetchRangeInterval ¶
func FetchRangeScoreInterval ¶
func LoadFields ¶
func LoadFields[T StructPointer](ctx context.Context, obj T) error
func PushAlteredConfig ¶
func PushAlteredConfig(env Environment)
func PushConfig ¶
func RemoveElement ¶
func SaveFields ¶
func SaveFields[T StructPointer](ctx context.Context, obj T) error
Types ¶
type Environment ¶
type Environment struct { Name string AgePublicKey string AgeSecretKey string AwsAccessKey string AwsSecretKey string AwsRegion string AwsBucket string AwsDialpadFolder string DbUrl string DbKeyPrefix string DialpadApiKey string DialpadWebhookSecret string HerokuHostUrl string MasterAdminId string MasterAdminEmail string }
func GetConfig ¶
func GetConfig() Environment
type StructPointer ¶
type StructPointer interface { Storable SetStorageId(id string) error Copy() StructPointer Downgrade(any) (StructPointer, error) }
Click to show internal directories.
Click to hide internal directories.