Documentation ¶
Index ¶
- func CollectionFor(t reflect.Type) string
- func ContextWithDatabaseConfig(ctx context.Context, cnf DatabaseConfig) context.Context
- func Create(ctx context.Context, val interface{}, comm *Common) ([]string, error)
- func Delete(ctx context.Context, item interface{}, comm *Common) error
- func List(ctx context.Context, offset, count int, out interface{}, comm *Common) (int, error)
- func ListKeys(ctx context.Context, keys []string, out interface{}, comm *Common) error
- func NewConnection(username, password string) *connection
- func NewFilesystemStorage(basePath string, maxMemory int64) *filesystemStorage
- func NewGraph(comm *Common) *graph
- func Read(ctx context.Context, key string, out interface{}, comm *Common) error
- func Update(ctx context.Context, key string, item interface{}, comm *Common) error
- func WriteErrorResponse(w http.ResponseWriter, status int, err error)
- func WriteFileResponse(w http.ResponseWriter, filename, fileContentType string, fileContent []byte)
- func WriteJSONResponse(w http.ResponseWriter, status int, data interface{})
- func WriteResponse(w http.ResponseWriter, status int, data []byte)
- func WriteSuccessResponse(w http.ResponseWriter, status int)
- type ApplicationConfig
- type ApplicationConfigInit
- type Common
- type DatabaseConfig
- type Event
- type IConnection
- type IFileStorage
- type IObserver
- type Observer
- type Processor
- type SourceID
- type Topic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithDatabaseConfig ¶
func ContextWithDatabaseConfig(ctx context.Context, cnf DatabaseConfig) context.Context
ContextWithDatabaseConfig ...
func NewFilesystemStorage ¶ added in v0.0.6
NewFilesystemStorage ...
func WriteErrorResponse ¶
func WriteErrorResponse(w http.ResponseWriter, status int, err error)
func WriteFileResponse ¶ added in v0.0.6
func WriteFileResponse(w http.ResponseWriter, filename, fileContentType string, fileContent []byte)
func WriteJSONResponse ¶
func WriteJSONResponse(w http.ResponseWriter, status int, data interface{})
func WriteResponse ¶ added in v0.0.2
func WriteResponse(w http.ResponseWriter, status int, data []byte)
Utils
func WriteSuccessResponse ¶
func WriteSuccessResponse(w http.ResponseWriter, status int)
Types ¶
type ApplicationConfig ¶ added in v0.0.9
type ApplicationConfig struct { // Name ... Name string `json:"name"` // Domain ... Domain string `json:"domain"` // Logo ... Logo string `json:"logo"` }
ApplicationConfig ...
type ApplicationConfigInit ¶ added in v0.0.9
type ApplicationConfigInit struct { // Config ... Config ApplicationConfig `json:"config"` // Admin ... Admin adminv1.Admin `json:"admin"` // Password ... Password string `json:"password"` }
ApplicationConfigInit ...
type Common ¶
type Common struct { Observer IObserver[Topic] Connection IConnection Storage IFileStorage }
type DatabaseConfig ¶
type DatabaseConfig struct { // Name ... Name string }
DatabaseConfig ...
func DatabaseConfigFromContext ¶
func DatabaseConfigFromContext(ctx context.Context) (*DatabaseConfig, error)
DatabaseConfigFromContext ...
type Event ¶
type Event[T comparable] struct { // Topic ... Topic T // Payload ... Payload protoreflect.ProtoMessage // Timestamp ... Timestamp time.Time }
Event ...
type IConnection ¶
type IConnection interface { // GetDatabase ... GetDatabase(ctx context.Context) (driver.Database, error) // GetCollection ... GetCollection(ctx context.Context, elem reflect.Type) (driver.Collection, error) }
IConnection ...
type IFileStorage ¶ added in v0.0.6
type IFileStorage interface { // StoreFile ... StoreFile(name string, file []byte) (err error) // StoreByHash ... StoreByHash(file multipart.File) (hash string, err error) // ReadFile ... ReadFile(name string) (fileContent []byte, errr error) // MaxMemory ... MaxMemory() int64 }
IFileStorage ...
type IObserver ¶
type IObserver[T comparable] interface { // Subscribe ... Subscribe(t T, p Processor[T]) SourceID // Unsubscribe ... Unsubscribe(s SourceID) // Emit ... Emit(e *Event[T]) error }
IObserver ...
type Observer ¶
type Observer[T comparable] struct { // contains filtered or unexported fields }
Observer ...
Source Files ¶
Click to show internal directories.
Click to hide internal directories.