state

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorEmptyState = errors.New("state is empty")
	ErrorNotFound   = errors.New("key not found in state")
	ErrorKeyExists  = errors.New("key already exists in state")
	ErrorReadOnly   = errors.New("state is read-only")
)
View Source
var (
	ErrorFileNotFound = errors.New("not found")
)

Functions

func ArgListContains

func ArgListContains(args Arguments, arg Argument) bool

func ArgumentTypesEqual

func ArgumentTypesEqual(arg Argument, argTypes ...ArgumentType) bool

func BucketAndPath

func BucketAndPath(u *url.URL) (string, string)

func EqualArgs

func EqualArgs(a []Argument, b []Argument) bool

EqualArgs checks that the argument list a and b are equal. We go out of our way to check equality despite the order. complexity o(n^2)

func GetValueAsString

func GetValueAsString(ctx context.Context, r Reader, arg Argument) (string, error)

func MustGetBool

func MustGetBool(s Handler, ctx context.Context, arg Argument) bool

func MustGetDirectory

func MustGetDirectory(s Handler, ctx context.Context, arg Argument) fs.FS

func MustGetDirectoryString

func MustGetDirectoryString(s Handler, ctx context.Context, arg Argument) string

func MustGetFile

func MustGetFile(s Handler, ctx context.Context, arg Argument) *os.File

func MustGetFloat64

func MustGetFloat64(s Handler, ctx context.Context, arg Argument) float64

func MustGetInt64

func MustGetInt64(s Handler, ctx context.Context, arg Argument) int64

func MustGetString

func MustGetString(s Handler, ctx context.Context, arg Argument) string

func SetValueFromJSON

func SetValueFromJSON(ctx context.Context, w Writer, value StateValueJSON) error

Types

type ArgMapReader

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

ArgMapReader attempts to read state values from the provided "ArgMap". The ArgMap is provided by the user by using the '-arg={key}={value}' argument. This is typically only used in local executions where some values will not be provided.

func NewArgMapReader

func NewArgMapReader(defaults args.ArgMap) *ArgMapReader

func (*ArgMapReader) Exists

func (s *ArgMapReader) Exists(ctx context.Context, arg Argument) (bool, error)

func (*ArgMapReader) GetBool

func (s *ArgMapReader) GetBool(ctx context.Context, arg Argument) (bool, error)

func (*ArgMapReader) GetDirectory

func (s *ArgMapReader) GetDirectory(ctx context.Context, arg Argument) (fs.FS, error)

func (*ArgMapReader) GetDirectoryString

func (s *ArgMapReader) GetDirectoryString(ctx context.Context, arg Argument) (string, error)

func (*ArgMapReader) GetFile

func (s *ArgMapReader) GetFile(ctx context.Context, arg Argument) (*os.File, error)

func (*ArgMapReader) GetFloat64

func (s *ArgMapReader) GetFloat64(ctx context.Context, arg Argument) (float64, error)

func (*ArgMapReader) GetInt64

func (s *ArgMapReader) GetInt64(ctx context.Context, arg Argument) (int64, error)

func (*ArgMapReader) GetString

func (s *ArgMapReader) GetString(ctx context.Context, arg Argument) (string, error)

type Argument

type Argument struct {
	Type ArgumentType
	Key  string
}

An Argument is a pre-defined argument that is used in a typical CI pipeline. This allows the flow library to define different methods of retrieving the same information on various clients. For example, when running in CLI or Dagger client, getting the git ref might be as simple as running `git rev-parse HEAD`. But in a Drone pipeline, that information may be available before the repository has been cloned in an environment variable. Other arguments may require the user to be prompted if they have not been provided. These arguments can be provided to the CLI by using the flag `-arg`, for example `-arg=workdir=./example` will set the "workdir" argument to "example" in the CLI client. By default, all steps expect a WorkingDir and Repository.

func NewBoolArgument

func NewBoolArgument(key string) Argument

func NewDirectoryArgument

func NewDirectoryArgument(key string) Argument

func NewFileArgument

func NewFileArgument(key string) Argument

func NewFloat64Argument

func NewFloat64Argument(key string) Argument

func NewInt64Argument

func NewInt64Argument(key string) Argument

func NewSecretArgument

func NewSecretArgument(key string) Argument

func NewStringArgument

func NewStringArgument(key string) Argument

func NewUnpackagedDirectoryArgument

func NewUnpackagedDirectoryArgument(key string) Argument

func Without

func Without(args []Argument, exclude []Argument) []Argument

Without returns a list of Arguments equal to `args` without the args in the `exclude` list. complexity o(n^2)

type ArgumentType

type ArgumentType int
const (
	ArgumentTypeString ArgumentType = iota
	ArgumentTypeInt64
	ArgumentTypeFloat64
	ArgumentTypeBool
	ArgumentTypeSecret
	ArgumentTypeFile
	ArgumentTypeFS
	// An ArgumentTypeUnpackagedFS is used for filesystems that are invariably consistent regardless of operating system.
	// Developers can get around packaging and unpackaging of large directories using this argument type.
	// Filesystems and directories used with this argument should always exist on every machine. This basically means that they should be available within the source tree.
	// If this argument type is used for directories outside of the source tree, then expect divergeant behavior between operating systems.
	ArgumentTypeUnpackagedFS
)

func (ArgumentType) String

func (a ArgumentType) String() string

type Arguments

type Arguments []Argument

func (*Arguments) String

func (a *Arguments) String() string

type FilesystemState

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

FilesystemState stores state in a JSON file on the filesystem.

func NewFilesystemState

func NewFilesystemState(path string) (*FilesystemState, error)

func (*FilesystemState) Exists

func (f *FilesystemState) Exists(ctx context.Context, arg Argument) (bool, error)

func (*FilesystemState) GetBool

func (f *FilesystemState) GetBool(ctx context.Context, arg Argument) (bool, error)

func (*FilesystemState) GetDirectory

func (f *FilesystemState) GetDirectory(ctx context.Context, arg Argument) (fs.FS, error)

func (*FilesystemState) GetDirectoryString

func (f *FilesystemState) GetDirectoryString(ctx context.Context, arg Argument) (string, error)

GetDirectoryString retrieves the original directory path. This can be particularly useful for things stored within the source filesystem.

func (*FilesystemState) GetFile

func (f *FilesystemState) GetFile(ctx context.Context, arg Argument) (*os.File, error)

func (*FilesystemState) GetFloat64

func (f *FilesystemState) GetFloat64(ctx context.Context, arg Argument) (float64, error)

func (*FilesystemState) GetInt64

func (f *FilesystemState) GetInt64(ctx context.Context, arg Argument) (int64, error)

func (*FilesystemState) GetString

func (f *FilesystemState) GetString(ctx context.Context, arg Argument) (string, error)

func (*FilesystemState) SetBool

func (f *FilesystemState) SetBool(ctx context.Context, arg Argument, value bool) error

func (*FilesystemState) SetDirectory

func (f *FilesystemState) SetDirectory(ctx context.Context, arg Argument, value string) error

func (*FilesystemState) SetFile

func (f *FilesystemState) SetFile(ctx context.Context, arg Argument, value string) error

func (*FilesystemState) SetFileReader

func (f *FilesystemState) SetFileReader(ctx context.Context, arg Argument, value io.Reader) (string, error)

func (*FilesystemState) SetFloat64

func (f *FilesystemState) SetFloat64(ctx context.Context, arg Argument, value float64) error

func (*FilesystemState) SetInt64

func (f *FilesystemState) SetInt64(ctx context.Context, arg Argument, value int64) error

func (*FilesystemState) SetString

func (f *FilesystemState) SetString(ctx context.Context, arg Argument, value string) error

type GCSHandler

type GCSHandler struct {
	*ObjectStorageHandler
}

GCSHandler uses the S3 API but with a round-tripper that makes the API client compatible with the S3 api

func NewGCSHandler

func NewGCSHandler(client *storage.Client, u *url.URL) (*GCSHandler, error)

type GCSObjectStorage

type GCSObjectStorage struct {
	Client *storage.Client
}

func (*GCSObjectStorage) GetObject

func (s *GCSObjectStorage) GetObject(ctx context.Context, bucket, key string) (*GetObjectResponse, error)

func (*GCSObjectStorage) PutObject

func (s *GCSObjectStorage) PutObject(ctx context.Context, bucket, key string, body io.Reader) error

type GetObjectResponse

type GetObjectResponse struct {
	Body io.ReadCloser
}

type Handler

type Handler interface {
	Reader
	Writer
}

type HandlerLogWrapper

type HandlerLogWrapper struct {
	*ReaderLogWrapper
	*WriterLogWrapper
}

func HandlerWithLogs

func HandlerWithLogs(log logrus.FieldLogger, state Handler) *HandlerLogWrapper

type JSONState

type JSONState map[string]StateValueJSON

type NoOpHandler

type NoOpHandler struct{}

NoOpHandler is a Handler that does nothing and is only used in tests where state is ignored but should never be nil.

func NewNoOpHandler

func NewNoOpHandler() *NoOpHandler

func (*NoOpHandler) Exists

func (n *NoOpHandler) Exists(ctx context.Context, arg Argument) (bool, error)

Reader functions

func (*NoOpHandler) GetBool

func (n *NoOpHandler) GetBool(ctx context.Context, arg Argument) (bool, error)

func (*NoOpHandler) GetDirectory

func (n *NoOpHandler) GetDirectory(ctx context.Context, arg Argument) (fs.FS, error)

func (*NoOpHandler) GetDirectoryString

func (n *NoOpHandler) GetDirectoryString(ctx context.Context, arg Argument) (string, error)

func (*NoOpHandler) GetFile

func (n *NoOpHandler) GetFile(ctx context.Context, arg Argument) (*os.File, error)

func (*NoOpHandler) GetFloat64

func (n *NoOpHandler) GetFloat64(ctx context.Context, arg Argument) (float64, error)

func (*NoOpHandler) GetInt64

func (n *NoOpHandler) GetInt64(ctx context.Context, arg Argument) (int64, error)

func (*NoOpHandler) GetString

func (n *NoOpHandler) GetString(ctx context.Context, arg Argument) (string, error)

func (*NoOpHandler) SetBool

func (n *NoOpHandler) SetBool(ctx context.Context, arg Argument, val bool) error

func (*NoOpHandler) SetDirectory

func (n *NoOpHandler) SetDirectory(ctx context.Context, arg Argument, dir string) error

func (*NoOpHandler) SetFile

func (n *NoOpHandler) SetFile(ctx context.Context, arg Argument, path string) error

func (*NoOpHandler) SetFileReader

func (n *NoOpHandler) SetFileReader(ctx context.Context, arg Argument, r io.Reader) (string, error)

func (*NoOpHandler) SetFloat64

func (n *NoOpHandler) SetFloat64(ctx context.Context, arg Argument, val float64) error

func (*NoOpHandler) SetInt64

func (n *NoOpHandler) SetInt64(ctx context.Context, arg Argument, val int64) error

func (*NoOpHandler) SetString

func (n *NoOpHandler) SetString(ctx context.Context, arg Argument, val string) error

Writer functions

type ObjectStorage

type ObjectStorage interface {
	GetObject(ctx context.Context, bucket, key string) (*GetObjectResponse, error)
	PutObject(ctx context.Context, bucket, key string, body io.Reader) error
}

type ObjectStorageHandler

type ObjectStorageHandler struct {
	Storage  ObjectStorage
	Bucket   string
	BasePath string
	// contains filtered or unexported fields
}

func NewObjectStorageHandler

func NewObjectStorageHandler(storage ObjectStorage, bucket, base string) *ObjectStorageHandler

func (*ObjectStorageHandler) Exists

func (s *ObjectStorageHandler) Exists(ctx context.Context, arg Argument) (bool, error)

func (*ObjectStorageHandler) GetBool

func (s *ObjectStorageHandler) GetBool(ctx context.Context, arg Argument) (bool, error)

func (*ObjectStorageHandler) GetDirectory

func (s *ObjectStorageHandler) GetDirectory(ctx context.Context, arg Argument) (fs.FS, error)

func (*ObjectStorageHandler) GetDirectoryString

func (s *ObjectStorageHandler) GetDirectoryString(ctx context.Context, arg Argument) (string, error)

func (*ObjectStorageHandler) GetFile

func (s *ObjectStorageHandler) GetFile(ctx context.Context, arg Argument) (*os.File, error)

func (*ObjectStorageHandler) GetFloat64

func (s *ObjectStorageHandler) GetFloat64(ctx context.Context, arg Argument) (float64, error)

func (*ObjectStorageHandler) GetInt64

func (s *ObjectStorageHandler) GetInt64(ctx context.Context, arg Argument) (int64, error)

func (*ObjectStorageHandler) GetString

func (s *ObjectStorageHandler) GetString(ctx context.Context, arg Argument) (string, error)

func (*ObjectStorageHandler) SetBool

func (s *ObjectStorageHandler) SetBool(ctx context.Context, arg Argument, value bool) error

func (*ObjectStorageHandler) SetDirectory

func (s *ObjectStorageHandler) SetDirectory(ctx context.Context, arg Argument, path string) error

func (*ObjectStorageHandler) SetFile

func (s *ObjectStorageHandler) SetFile(ctx context.Context, arg Argument, path string) error

func (*ObjectStorageHandler) SetFileReader

func (s *ObjectStorageHandler) SetFileReader(ctx context.Context, arg Argument, r io.Reader) (string, error)

func (*ObjectStorageHandler) SetFloat64

func (s *ObjectStorageHandler) SetFloat64(ctx context.Context, arg Argument, value float64) error

func (*ObjectStorageHandler) SetInt64

func (s *ObjectStorageHandler) SetInt64(ctx context.Context, arg Argument, value int64) error

func (*ObjectStorageHandler) SetString

func (s *ObjectStorageHandler) SetString(ctx context.Context, arg Argument, value string) error

type Observer

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

func NewObserver

func NewObserver(h Handler) *Observer

func (*Observer) CondFor

func (o *Observer) CondFor(ctx context.Context, arg Argument) *sync.Cond

func (*Observer) Exists

func (o *Observer) Exists(ctx context.Context, arg Argument) (bool, error)

Reader functions

func (*Observer) GetBool

func (o *Observer) GetBool(ctx context.Context, arg Argument) (bool, error)

func (*Observer) GetDirectory

func (o *Observer) GetDirectory(ctx context.Context, arg Argument) (fs.FS, error)

func (*Observer) GetDirectoryString

func (o *Observer) GetDirectoryString(ctx context.Context, arg Argument) (string, error)

func (*Observer) GetFile

func (o *Observer) GetFile(ctx context.Context, arg Argument) (*os.File, error)

func (*Observer) GetFloat64

func (o *Observer) GetFloat64(ctx context.Context, arg Argument) (float64, error)

func (*Observer) GetInt64

func (o *Observer) GetInt64(ctx context.Context, arg Argument) (int64, error)

func (*Observer) GetString

func (o *Observer) GetString(ctx context.Context, arg Argument) (string, error)

func (*Observer) Notify

func (o *Observer) Notify(ctx context.Context, arg Argument)

func (*Observer) SetBool

func (o *Observer) SetBool(ctx context.Context, arg Argument, val bool) error

func (*Observer) SetDirectory

func (o *Observer) SetDirectory(ctx context.Context, arg Argument, dir string) error

func (*Observer) SetFile

func (o *Observer) SetFile(ctx context.Context, arg Argument, path string) error

func (*Observer) SetFileReader

func (o *Observer) SetFileReader(ctx context.Context, arg Argument, r io.Reader) (string, error)

func (*Observer) SetFloat64

func (o *Observer) SetFloat64(ctx context.Context, arg Argument, val float64) error

func (*Observer) SetInt64

func (o *Observer) SetInt64(ctx context.Context, arg Argument, val int64) error

func (*Observer) SetString

func (o *Observer) SetString(ctx context.Context, arg Argument, val string) error

Writer functions

type Reader

type Reader interface {
	Exists(context.Context, Argument) (bool, error)
	GetString(context.Context, Argument) (string, error)
	GetInt64(context.Context, Argument) (int64, error)
	GetFloat64(context.Context, Argument) (float64, error)
	GetBool(context.Context, Argument) (bool, error)
	GetFile(context.Context, Argument) (*os.File, error)
	GetDirectory(context.Context, Argument) (fs.FS, error)
	GetDirectoryString(context.Context, Argument) (string, error)
}

type ReaderLogWrapper

type ReaderLogWrapper struct {
	Reader
	Log logrus.FieldLogger
}

func ReaderWithLogs

func ReaderWithLogs(log logrus.FieldLogger, state Reader) *ReaderLogWrapper

func (*ReaderLogWrapper) Exists

func (s *ReaderLogWrapper) Exists(ctx context.Context, arg Argument) (bool, error)

func (*ReaderLogWrapper) GetDirectory

func (s *ReaderLogWrapper) GetDirectory(ctx context.Context, arg Argument) (fs.FS, error)

func (*ReaderLogWrapper) GetDirectoryString

func (s *ReaderLogWrapper) GetDirectoryString(ctx context.Context, arg Argument) (string, error)

func (*ReaderLogWrapper) GetFile

func (s *ReaderLogWrapper) GetFile(ctx context.Context, arg Argument) (*os.File, error)

func (*ReaderLogWrapper) GetFloat64

func (s *ReaderLogWrapper) GetFloat64(ctx context.Context, arg Argument) (float64, error)

func (*ReaderLogWrapper) GetInt64

func (s *ReaderLogWrapper) GetInt64(ctx context.Context, arg Argument) (int64, error)

func (*ReaderLogWrapper) GetString

func (s *ReaderLogWrapper) GetString(ctx context.Context, arg Argument) (string, error)

type S3Handler

type S3Handler struct {
	*ObjectStorageHandler
}

func NewS3Handler

func NewS3Handler(client *s3.Client, u *url.URL) (*S3Handler, error)

type S3ObjectStorage

type S3ObjectStorage struct {
	Client *s3.Client
}

func (*S3ObjectStorage) GetObject

func (s *S3ObjectStorage) GetObject(ctx context.Context, bucket, key string) (*GetObjectResponse, error)

func (*S3ObjectStorage) PutObject

func (s *S3ObjectStorage) PutObject(ctx context.Context, bucket, key string, body io.Reader) error

type State

type State struct {
	Handler  Handler
	Fallback []Reader
	Log      logrus.FieldLogger
}

func NewDefaultState

func NewDefaultState(ctx context.Context, log logrus.FieldLogger, pargs *args.PipelineArgs) (*State, error)

NewDefaultState creates a new default state given the arguments provided. The --no-stdin flag will prevent the State object from using the stdin to populate the state for ClientProvidedArguments. (See `pipeline/arguments_known.go` for those). The --state flag defines where the state JSON and state data will be stored. If the value for a key is not available in the primary state (defined by the --state flag), then the state object will attempt to retrieve it from the fallback. Currently, the fallback options are the `--arg` flags (--arg={key}={value}), or, if `--no-stdin` is not set, then from the stdin.

func (*State) Exists

func (s *State) Exists(ctx context.Context, arg Argument) (bool, error)

Exists checks the state to see if an argument exists in it. It can return an error in the event of a failure to check the state. An error will not be returned if the state could be read and the value was not in it. If a value for argument was not found, then false and a nil error is returned.

func (*State) GetBool

func (s *State) GetBool(ctx context.Context, arg Argument) (bool, error)

GetBool attempts to get the bool from the state. If there are Fallback readers and the state returned an error, then it will loop through each one, attempting to retrieve the value from the fallback state reader. If no fallback reader returns the value, then the original error is returned.

func (*State) GetDirectory

func (s *State) GetDirectory(ctx context.Context, arg Argument) (fs.FS, error)

GetDirectory attempts to get the directory from the state. If there are Fallback readers and the state returned an error, then it will loop through each one, attempting to retrieve the value from the fallback state reader. If no fallback reader returns the value, then the original error is returned.

func (*State) GetDirectoryString

func (s *State) GetDirectoryString(ctx context.Context, arg Argument) (string, error)

GetDirectory attempts to get the directory from the state. If there are Fallback readers and the state returned an error, then it will loop through each one, attempting to retrieve the value from the fallback state reader. If no fallback reader returns the value, then the original error is returned.

func (*State) GetFile

func (s *State) GetFile(ctx context.Context, arg Argument) (*os.File, error)

GetFile attempts to get the file from the state. If there are Fallback readers and the state returned an error, then it will loop through each one, attempting to retrieve the value from the fallback state reader. If no fallback reader returns the value, then the original error is returned.

func (*State) GetFloat64

func (s *State) GetFloat64(ctx context.Context, arg Argument) (float64, error)

GetFloat64 attempts to get the int64 from the state. If there are Fallback readers and the state returned an error, then it will loop through each one, attempting to retrieve the value from the fallback state reader. If no fallback reader returns the value, then the original error is returned.

func (*State) GetInt64

func (s *State) GetInt64(ctx context.Context, arg Argument) (int64, error)

GetInt64 attempts to get the int64 from the state. If there are Fallback readers and the state returned an error, then it will loop through each one, attempting to retrieve the value from the fallback state reader. If no fallback reader returns the value, then the original error is returned.

func (*State) GetString

func (s *State) GetString(ctx context.Context, arg Argument) (string, error)

GetString attempts to get the string from the state. If there are Fallback readers and the state returned an error, then it will loop through each one, attempting to retrieve the value from the fallback state reader. If no fallback reader returns the value, then the original error is returned.

func (*State) SetBool

func (s *State) SetBool(ctx context.Context, arg Argument, value bool) error

SetBool attempts to set the bool into the state.

func (*State) SetDirectory

func (s *State) SetDirectory(ctx context.Context, arg Argument, path string) error

SetDirectory attempts to set the directory into the state. The "path" argument should be the path to the directory to be stored.

func (*State) SetFile

func (s *State) SetFile(ctx context.Context, arg Argument, path string) error

SetFile attempts to set the file into the state. The "path" argument should be the path to the file to be stored.

func (*State) SetFileReader

func (s *State) SetFileReader(ctx context.Context, arg Argument, r io.Reader) (string, error)

SetFileReader attempts to set the reader into the state as a file. This is an easy way to go from downloading a file to setting it into the state without having to write it to disk first.

func (*State) SetFloat64

func (s *State) SetFloat64(ctx context.Context, arg Argument, value float64) error

SetFloat64 attempts to set the float64 into the state.

func (*State) SetInt64

func (s *State) SetInt64(ctx context.Context, arg Argument, value int64) error

SetInt64 attempts to set the int64 into the state.

func (*State) SetString

func (s *State) SetString(ctx context.Context, arg Argument, value string) error

SetString attempts to set the string into the state.

type StateValueJSON

type StateValueJSON struct {
	Argument Argument `json:"argument"`
	Value    any      `json:"value"`
}

type StdinReader

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

func NewStdinReader

func NewStdinReader(in io.Reader, out io.Writer) *StdinReader

func (*StdinReader) Exists

func (s *StdinReader) Exists(ctx context.Context, arg Argument) (bool, error)

Since the StdinReader can read any state value, it's better if we assume that if it's being used, then it wasn't found in other reasonable state managers.

func (*StdinReader) Get

func (s *StdinReader) Get(arg Argument) (string, error)

func (*StdinReader) GetBool

func (s *StdinReader) GetBool(ctx context.Context, arg Argument) (bool, error)

func (*StdinReader) GetDirectory

func (s *StdinReader) GetDirectory(ctx context.Context, arg Argument) (fs.FS, error)

func (*StdinReader) GetDirectoryString

func (s *StdinReader) GetDirectoryString(ctx context.Context, arg Argument) (string, error)

func (*StdinReader) GetFile

func (s *StdinReader) GetFile(ctx context.Context, arg Argument) (*os.File, error)

func (*StdinReader) GetFloat64

func (s *StdinReader) GetFloat64(ctx context.Context, arg Argument) (float64, error)

func (*StdinReader) GetInt64

func (s *StdinReader) GetInt64(ctx context.Context, arg Argument) (int64, error)

func (*StdinReader) GetString

func (s *StdinReader) GetString(ctx context.Context, arg Argument) (string, error)

type Writer

type Writer interface {
	SetString(context.Context, Argument, string) error
	SetInt64(context.Context, Argument, int64) error
	SetFloat64(context.Context, Argument, float64) error
	SetBool(context.Context, Argument, bool) error
	SetFile(context.Context, Argument, string) error
	SetFileReader(context.Context, Argument, io.Reader) (string, error)
	SetDirectory(context.Context, Argument, string) error
}

type WriterLogWrapper

type WriterLogWrapper struct {
	Writer
	Log logrus.FieldLogger
}

func WriterWithLogs

func WriterWithLogs(log logrus.FieldLogger, state Writer) *WriterLogWrapper

func (*WriterLogWrapper) SetDirectory

func (s *WriterLogWrapper) SetDirectory(ctx context.Context, arg Argument, val string) error

func (*WriterLogWrapper) SetFile

func (s *WriterLogWrapper) SetFile(ctx context.Context, arg Argument, val string) error

func (*WriterLogWrapper) SetFileReader

func (s *WriterLogWrapper) SetFileReader(ctx context.Context, arg Argument, val io.Reader) (string, error)

func (*WriterLogWrapper) SetFloat64

func (s *WriterLogWrapper) SetFloat64(ctx context.Context, arg Argument, val float64) error

func (*WriterLogWrapper) SetInt64

func (s *WriterLogWrapper) SetInt64(ctx context.Context, arg Argument, val int64) error

func (*WriterLogWrapper) SetString

func (s *WriterLogWrapper) SetString(ctx context.Context, arg Argument, val string) error

Jump to

Keyboard shortcuts

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