Jobs & Workflows https://armen.surge.sh
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
armen/internal/storage/storage.go

38 lines
1.1 KiB

/*
------------------------------------------------------------------------------------------------------------------------
####### storage ####### Copyright (c) 2021 mls-361 ################################################# MIT License #######
------------------------------------------------------------------------------------------------------------------------
*/
package storage
import (
"forge.chapril.org/armen/memory"
"forge.chapril.org/mls-361/errors"
"forge.chapril.org/armen/armen/internal/components"
)
// Build AFAIRE.
func Build(app components.Application,
config components.Config,
logger components.Logger,
crypto components.Crypto) (components.Storage, error) {
cfg := config.Storage()
switch cfg.Type {
case "memory":
return memory.New(), nil
default:
return nil, errors.New( ////////////////////////////////////////////////////////////////////////////////////////
"this storage type is unknown",
"type", cfg.Type,
)
}
}
/*
######################################################################################################## @(°_°)@ #######
*/