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.
|
|
|
/*
|
|
|
|
------------------------------------------------------------------------------------------------------------------------
|
|
|
|
####### 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(ccs *components.Components) (components.Storage, error) {
|
|
|
|
cfg := ccs.Config.Storage()
|
|
|
|
|
|
|
|
switch cfg.Impl {
|
|
|
|
case "memory":
|
|
|
|
return memory.New(), nil
|
|
|
|
default:
|
|
|
|
return nil, errors.New( ////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
"this implementation does not exist",
|
|
|
|
"impl", cfg.Impl,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
######################################################################################################## @(°_°)@ #######
|
|
|
|
*/
|