languages

package
v0.0.0-...-63f4637 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLanguageSources

func GetLanguageSources() []string

GetLanguageSources returns the language sources

Types

type AdderAdminResources

type AdderAdminResources interface {
	AddResource(value interface{}, config ...*admin.Config) *admin.Resource
}

AdderAdminResources adds resources to the admin

type AdderMultipleCommands

type AdderMultipleCommands interface {
	AddCommand(...*cobra.Command)
}

AdderMultipleCommands adds cmd commands to the other command.

type AdminConfig

type AdminConfig interface {
	GetListFields() []interface{}
	GetEditFields() []interface{}
}

AdminConfig is a resource admin configuration

type AdminMixin

type AdminMixin interface {
	Apply(interface{ AdminResource }, interface{ AdminConfig })
}

AdminMixin is a mixin for applying additional behavior the resource admin

type AdminResource

type AdminResource interface {
	IndexAttrs(values ...interface{}) []*admin.Section
	ShowAttrs(values ...interface{}) []*admin.Section
	NewAttrs(values ...interface{}) []*admin.Section
	EditAttrs(values ...interface{}) []*admin.Section
	Filter(filter *admin.Filter)
}

AdminResource is the admin resource interface.

type AdminResourcesRegister

type AdminResourcesRegister interface {
	Register(adm interface{ AdderAdminResources })
}

AdminResourcesRegister register admin resources

type App

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

App is the application structure.

func NewApp

func NewApp(conn autoMigrater, logger Logger, mixins ...AdminMixin) *App

NewApp returns a new app object.

func (*App) AddAdminResources

func (a *App) AddAdminResources(adm interface{ AdderAdminResources })

AddAdminResources adds the app admin resources commands.

func (*App) AddCommands

func (a *App) AddCommands(rootCmd interface{ AdderMultipleCommands })

AddCommands adds the app cmd commands.

func (*App) Migrate

func (a *App) Migrate()

Migrate does the app migrations.

type Language

type Language struct {
	gorm.Model
	Title    string `gorm:"size:100;not null;index:title"`
	Position uint   `gorm:"not null;index:position"`
	Source   string `gorm:"size:100;not null;index:source"`
}

Language is a programming language struct

func (*Language) Validate

func (l *Language) Validate(db *gorm.DB)

Validate validates struct

type Logger

type Logger interface {
	Infof(format string, args ...interface{})
	Error(args ...interface{})
}

Logger logs errors and info.

type Scrapper

type Scrapper interface {
	Scrap() ([]*Language, error)
}

type ScrappersRunner

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

func NewScrapperRunner

func NewScrapperRunner(logger Logger) *ScrappersRunner

func (*ScrappersRunner) Run

func (s *ScrappersRunner) Run()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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