types

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllFeatures = Features{
	Wiki:          true,
	Issues:        true,
	Milestones:    true,
	Labels:        true,
	Releases:      true,
	PullRequests:  true,
	ReleaseAssets: true,
}

Functions

func ForgePasswordOption

func ForgePasswordOption(prefix string) string

func ForgeTokenOption

func ForgeTokenOption(prefix string) string

func ForgeTypeOption

func ForgeTypeOption(direction string) string

func ForgeUserOption

func ForgeUserOption(prefix string) string

func GetFlagsAuth

func GetFlagsAuth(prefix, category string) []cli.Flag

func GetFlagsSelector

func GetFlagsSelector() []cli.Flag

func NewLogContext

func NewLogContext(ctx context.Context) context.Context

func SetVerbosity

func SetVerbosity(ctx context.Context, verbosity int)

Types

type Configuration

type Configuration struct {
	Version                string
	Type                   string
	Verbose                bool
	URL                    string
	Directory              string
	NewMigrationHTTPClient NewMigrationHTTPClientFun `json:"-"`
}

func (Configuration) GetDirectory

func (c Configuration) GetDirectory() string

func (*Configuration) GetNewMigrationHTTPClient

func (c *Configuration) GetNewMigrationHTTPClient() NewMigrationHTTPClientFun

func (Configuration) GetType

func (c Configuration) GetType() string

func (Configuration) GetURL

func (c Configuration) GetURL() string

func (Configuration) GetVersion

func (c Configuration) GetVersion() string

func (*Configuration) SetNewMigrationHTTPClient

func (c *Configuration) SetNewMigrationHTTPClient(fun NewMigrationHTTPClientFun)

type Features

type Features struct {
	Wiki          bool
	Issues        bool
	Milestones    bool
	Labels        bool
	Releases      bool
	PullRequests  bool
	ReleaseAssets bool
}

type Level

type Level int
const (
	LevelTrace    Level = Level(slog.LevelDebug)
	LevelDebug    Level = Level(slog.LevelDebug)
	LevelInfo     Level = Level(slog.LevelInfo)
	LevelWarn     Level = Level(slog.LevelWarn)
	LevelError    Level = Level(slog.LevelError)
	LevelCritical Level = Level(slog.LevelError)
	LevelFatal    Level = Level(slog.LevelError)
)

type Logger

type Logger struct {
	Message  LoggerFun
	Trace    LoggerFun
	Debug    LoggerFun
	Info     LoggerFun
	Warn     LoggerFun
	Error    LoggerFun
	Critical LoggerFun
	Fatal    LoggerFun
	// contains filtered or unexported fields
}

func GetLogger

func GetLogger(ctx context.Context) *Logger

func NewLogger

func NewLogger() *Logger

func (*Logger) GetLevel

func (o *Logger) GetLevel() int

func (*Logger) SetDefaults

func (o *Logger) SetDefaults()

func (*Logger) SetLevel

func (o *Logger) SetLevel(level Level)

func (*Logger) SetWriter

func (o *Logger) SetWriter(out io.Writer)

type LoggerFun

type LoggerFun func(string, ...any)

type NewMigrationHTTPClientFun

type NewMigrationHTTPClientFun func() *http.Client

type Options

type Options struct {
	Logger        *Logger `json:"-"`
	Features      `json:"Features"`
	Configuration `json:"Configuration"`
}

func (*Options) FromFlags

func (o *Options) FromFlags(ctx context.Context, c *cli.Context, prefix string) OptionsInterface

func (*Options) GetConfiguration

func (o *Options) GetConfiguration() *Configuration

func (*Options) GetFeatures

func (o *Options) GetFeatures() Features

func (*Options) GetLogger

func (o *Options) GetLogger() *Logger

func (*Options) GetOptions

func (o *Options) GetOptions() OptionsInterface

func (*Options) GetType

func (o *Options) GetType() string

func (*Options) SetDefaults

func (o *Options) SetDefaults()

func (*Options) SetOptions

func (o *Options) SetOptions(otherInterface OptionsInterface)

type OptionsFactory

type OptionsFactory struct {
	Name          string
	New           func() OptionsInterface
	Flags         func(prefix, category string) []cli.Flag
	NeedAuthFlags bool
}

type OptionsInterface

type OptionsInterface interface {
	SetDefaults()
	GetType() string
	GetLogger() *Logger
	GetConfiguration() *Configuration
	GetFeatures() Features
	SetOptions(OptionsInterface)
	GetOptions() OptionsInterface
	FromFlags(context.Context, *cli.Context, string) OptionsInterface
}

Jump to

Keyboard shortcuts

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