Documentation ¶
Overview ¶
Copyright (c) 2024 rodneyosodo
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
Copyright (c) 2024 rodneyosodo ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
Copyright (c) 2024 rodneyosodo ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Host string `env:"HOST" envDefault:"localhost"` Port string `env:"PORT" envDefault:"5432"` User string `env:"USER" envDefault:"twiga"` Pass string `env:"PASS" envDefault:"twiga"` Name string `env:"NAME" envDefault:""` SSLMode string `env:"SSL_MODE" envDefault:"disable"` SSLCert string `env:"SSL_CERT" envDefault:""` SSLKey string `env:"SSL_KEY" envDefault:""` SSLRootCert string `env:"SSL_ROOT_CERT" envDefault:""` }
type Database ¶
type Database interface { NamedQueryContext(ctx context.Context, query string, args interface{}) (*sqlx.Rows, error) NamedExecContext(ctx context.Context, query string, args interface{}) (sql.Result, error) QueryRowxContext(ctx context.Context, query string, args ...interface{}) *sqlx.Row QueryxContext(ctx context.Context, query string, args ...interface{}) (*sqlx.Rows, error) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) BeginTxx(ctx context.Context, opts *sql.TxOptions) (*sqlx.Tx, error) }
Database provides a database interface.