port

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Copyright © 2022 Sylvia Waldron

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPathInvalid = errors.New("path is invalid")
	ErrEmptyName   = errors.New("name cannot be empty")
)

Functions

This section is empty.

Types

type Lineage

type Lineage int
const (
	None Lineage = iota
	Boom
	ZDoom
	MBF
	Eternity
)

func (*Lineage) Scan

func (l *Lineage) Scan(src interface{}) error

func (*Lineage) Set

func (l *Lineage) Set(v string) error

func (*Lineage) String

func (l *Lineage) String() string

func (*Lineage) Type

func (l *Lineage) Type() string

type Port

type Port struct {
	Name           string
	Path           string
	Lineage        Lineage
	CanPistolStart bool `db:"pistolstart"`
}

func DsdaDoom

func DsdaDoom() *Port

func New

func New(name, path string, lineage Lineage, canPistolStart bool) (*Port, error)

func (Port) String

func (p Port) String() string

type Repository

type Repository interface {
	Create(port *Port) error
	GetAll() ([]Port, error)
	GetByName(name string) (*Port, error)
	Update(updated *Port) error
	Delete(name string) error
}

type SqliteRepository

type SqliteRepository struct {
	// contains filtered or unexported fields
}

func NewSqliteRepository

func NewSqliteRepository(db *db.DB) (*SqliteRepository, error)

func (*SqliteRepository) Create

func (r *SqliteRepository) Create(port *Port) error

func (*SqliteRepository) Delete

func (r *SqliteRepository) Delete(name string) error

func (*SqliteRepository) GetAll

func (r *SqliteRepository) GetAll() ([]Port, error)

func (*SqliteRepository) GetByName

func (r *SqliteRepository) GetByName(name string) (*Port, error)

func (*SqliteRepository) Update

func (r *SqliteRepository) Update(updated *Port) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL