Documentation
¶
Index ¶
- Constants
- Variables
- func GetSupportedLanguages() map[string]string
- func NormalizeLanguage(language string) (string, error)
- type Config
- type ConfigBackup
- type ConfigRepository
- func (r *ConfigRepository) Exists() (bool, error)
- func (r *ConfigRepository) GetPath() string
- func (r *ConfigRepository) Load() (*Config, error)
- func (r *ConfigRepository) Restore(backup *ConfigBackup) error
- func (r *ConfigRepository) Save(cfg *Config) error
- func (r *ConfigRepository) SaveWithTemplate(cfg *Config) error
- type ConfigService
- func (s *ConfigService) ClearSession() error
- func (s *ConfigService) EditConfig() error
- func (s *ConfigService) EnsureConfig() (*Config, error)
- func (s *ConfigService) GetPath() string
- func (s *ConfigService) GetWarnings() []string
- func (s *ConfigService) IsSupportedLanguage(language string) bool
- func (s *ConfigService) SaveUsername(username string) error
- func (s *ConfigService) UpdateSession(session Session) error
- type ConfigValidator
- type Language
- type LanguageResult
- type Session
- type Workspace
Constants ¶
View Source
const DefaultLanguage = "go"
Variables ¶
View Source
var (
ErrUnsupportedLanguage = errors.New("language not supported")
)
Functions ¶
func GetSupportedLanguages ¶
func NormalizeLanguage ¶
Types ¶
type Config ¶
type Config struct {
OpenInEditor bool `yaml:"openInEditor"`
Verbose bool `yaml:"verbose"`
Session Session `yaml:"session,inline"`
Username string `yaml:"username"`
Tracks []string `yaml:"tracks"`
// contains filtered or unexported fields
}
func (*Config) HasValidSession ¶
func (*Config) LanguageName ¶
func (Config) MarshalYAML ¶
func (*Config) WorkspacePath ¶
type ConfigBackup ¶
type ConfigBackup struct {
Config *Config
}
func NewConfigBackup ¶
func NewConfigBackup(cfg *Config) *ConfigBackup
type ConfigRepository ¶
type ConfigRepository struct {
// contains filtered or unexported fields
}
func NewConfigRepository ¶
func NewConfigRepository() (*ConfigRepository, error)
func (*ConfigRepository) Exists ¶
func (r *ConfigRepository) Exists() (bool, error)
func (*ConfigRepository) GetPath ¶
func (r *ConfigRepository) GetPath() string
func (*ConfigRepository) Load ¶
func (r *ConfigRepository) Load() (*Config, error)
func (*ConfigRepository) Restore ¶
func (r *ConfigRepository) Restore(backup *ConfigBackup) error
func (*ConfigRepository) Save ¶
func (r *ConfigRepository) Save(cfg *Config) error
func (*ConfigRepository) SaveWithTemplate ¶
func (r *ConfigRepository) SaveWithTemplate(cfg *Config) error
type ConfigService ¶
type ConfigService struct {
// contains filtered or unexported fields
}
func New ¶
func New() (*ConfigService, error)
func NewConfigService ¶
func NewConfigService(repo ConfigRepository, validator ConfigValidator) *ConfigService
func (*ConfigService) ClearSession ¶
func (s *ConfigService) ClearSession() error
func (*ConfigService) EditConfig ¶
func (s *ConfigService) EditConfig() error
func (*ConfigService) EnsureConfig ¶
func (s *ConfigService) EnsureConfig() (*Config, error)
func (*ConfigService) GetPath ¶
func (s *ConfigService) GetPath() string
func (*ConfigService) GetWarnings ¶
func (s *ConfigService) GetWarnings() []string
func (*ConfigService) IsSupportedLanguage ¶
func (s *ConfigService) IsSupportedLanguage(language string) bool
func (*ConfigService) SaveUsername ¶
func (s *ConfigService) SaveUsername(username string) error
func (*ConfigService) UpdateSession ¶
func (s *ConfigService) UpdateSession(session Session) error
type ConfigValidator ¶
type ConfigValidator struct {
// contains filtered or unexported fields
}
func NewConfigValidator ¶
func NewConfigValidator() *ConfigValidator
func (*ConfigValidator) IsSupportedLanguage ¶
func (v *ConfigValidator) IsSupportedLanguage(lang string) bool
func (*ConfigValidator) Validate ¶
func (v *ConfigValidator) Validate(c *Config) error
func (*ConfigValidator) ValidateWithFallback ¶
func (v *ConfigValidator) ValidateWithFallback(c *Config) error
type LanguageResult ¶
func NewLanguageWithFallback ¶
func NewLanguageWithFallback(lang string) LanguageResult
Click to show internal directories.
Click to hide internal directories.