inputparser

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

* * Copyright (C) 2018 - 2023 SparrowOchon * License: Apache 2.0 * License Copy: https://www.apache.org/licenses/LICENSE-2.0.txt *

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PipeReader

func PipeReader(pipe_input chan<- []byte, inputs *InputParams) error

PipeReader Read data from the stdin if it was piped to this program

@param: <chan<- []byte> The input from the STDIN line by line converted to a []byte array. Notice that the FileReader will output this same data but it does so by reading a file.

@param: <InputParams ptr> Ptr to struct containing the input we recieved from the user. Passed to change IsPipedData if we are reading from Pipe.

@return: <error> Any error that occurred during the attempted read from Pipe. NOTE an error will be thrown if there is no Piped Data.

func ValidateInputs

func ValidateInputs(inputs *InputParams)

ValidateInputs parses cli arguments

@param: <InputParams ptr> Ptr to struct that will get input we received from the user written to as part of this function

Types

type InputParams

type InputParams struct {
	SourceFile      *string
	OutputFile      *string
	SearchedPackage *string
	IsPipedData     bool
}

InputParams Struct containing user provided inputs

SourceFile: <string ptr> path of file to read as a string

OutputFile: <string ptr> destination path to store the output DOT file as a string

SearchedPackage: <string ptr> package name we are looking for as a string

IsPipedData: <bool> Flag dictating if we have detected that data is being piped to this application

Jump to

Keyboard shortcuts

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