Documentation ¶
Index ¶
- func NewPostgresDB(ctx context.Context, cfg Config) (*sqlx.DB, error)
- type Config
- type Connection
- type ConnectionRepository
- func (c *ConnectionRepository) CreateConnection(ctx context.Context, conn *entity.Connection) (int, error)
- func (c *ConnectionRepository) GetConnectionById(ctx context.Context, id int) (*entity.Connection, error)
- func (c *ConnectionRepository) GetConnectionByServerId(ctx context.Context, id int) (*entity.Connection, error)
- func (c *ConnectionRepository) GetConnectionsByUserId(ctx context.Context, id int64) ([]entity.Connection, error)
- func (c *ConnectionRepository) GetLastConnectionPortCount(ctx context.Context) (*entity.ConnectionPortCount, error)
- func (c *ConnectionRepository) SaveConnection(ctx context.Context, conn *entity.Connection) error
- type Repo
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Connection ¶
type Connection interface { GetLastConnectionPortCount(ctx context.Context) (*entity.ConnectionPortCount, error) CreateConnection(ctx context.Context, connection *entity.Connection) (int, error) GetConnectionsByUserId(ctx context.Context, id int64) ([]entity.Connection, error) GetConnectionById(ctx context.Context, id int) (*entity.Connection, error) GetConnectionByServerId(ctx context.Context, id int) (*entity.Connection, error) SaveConnection(ctx context.Context, conn *entity.Connection) error }
type ConnectionRepository ¶
type ConnectionRepository struct {
// contains filtered or unexported fields
}
func NewConnectionRepository ¶
func NewConnectionRepository(db *sqlx.DB, log logger.Logger) *ConnectionRepository
func (*ConnectionRepository) CreateConnection ¶
func (c *ConnectionRepository) CreateConnection(ctx context.Context, conn *entity.Connection) (int, error)
func (*ConnectionRepository) GetConnectionById ¶
func (c *ConnectionRepository) GetConnectionById(ctx context.Context, id int) (*entity.Connection, error)
func (*ConnectionRepository) GetConnectionByServerId ¶
func (c *ConnectionRepository) GetConnectionByServerId(ctx context.Context, id int) (*entity.Connection, error)
func (*ConnectionRepository) GetConnectionsByUserId ¶
func (c *ConnectionRepository) GetConnectionsByUserId(ctx context.Context, id int64) ([]entity.Connection, error)
func (*ConnectionRepository) GetLastConnectionPortCount ¶
func (c *ConnectionRepository) GetLastConnectionPortCount(ctx context.Context) (*entity.ConnectionPortCount, error)
func (*ConnectionRepository) SaveConnection ¶
func (c *ConnectionRepository) SaveConnection(ctx context.Context, conn *entity.Connection) error
type Repository ¶
type Repository struct {
Connection
}
func NewRepository ¶
func NewRepository(db *sqlx.DB, log logger.Logger) *Repository
Click to show internal directories.
Click to hide internal directories.