cmdutil

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: Apache-2.0 Imports: 24 Imported by: 1

Documentation

Overview

Copyright 2021 Cloud Privacy Labs, LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const JSSource = `` /* 7932-byte string literal not displayed */

JSSource returns the svgpan.js file

Variables

This section is empty.

Functions

func InitConfig

func InitConfig(cfg Config)

func NewDocumentGraph

func NewDocumentGraph() *lpg.Graph

func ReadFileOrStdin

func ReadFileOrStdin(input []string) ([]byte, error)

ReadFileOrStdin reads a file or reads stdin

func ReadGraph

func ReadGraph(gfile []string, interner ls.Interner, inputFormat string) (*lpg.Graph, error)

func ReadGraphFromReader

func ReadGraphFromReader(ctx context.Context, reader io.Reader, interner ls.Interner, inputFormat string) (<-chan GraphStream, error)

func ReadJSON

func ReadJSON(input string, output interface{}, enc ...encoding.Encoding) error

ReadJSON reads JSON from a file or a URL

func ReadJSONFileOrStdin

func ReadJSONFileOrStdin(input []string, output interface{}, enc ...encoding.Encoding) error

ReadJSONFileOrStdin reads a JSON file(s), or if there are none, reads from stdin

func ReadJSONGraph

func ReadJSONGraph(gfile []string, interner ls.Interner) (*lpg.Graph, error)

func ReadJSONLDGraph

func ReadJSONLDGraph(gfile []string, interner ls.Interner) (*lpg.Graph, error)

func ReadJSONMultiple

func ReadJSONMultiple(input []string) ([]interface{}, error)

ReadJSONMultiple reads multiple JSON files

func ReadJSONOrYAML

func ReadJSONOrYAML(input string, output interface{}, enc ...encoding.Encoding) error

func ReadSheets

func ReadSheets(fileName string) ([][][]string, error)

ReadSpreadsheetFile reads a CSV or Excel file. For CSV, it will look at the environment variable CSV_SEPARATOR. For Excel, it will load all the spreadsheets

func ReadSpreadsheetFile

func ReadSpreadsheetFile(fileName string) (map[string][][]string, error)

func ReadURL

func ReadURL(input string, enc ...encoding.Encoding) ([]byte, error)

ReadURL reads a file or a URL

func StreamFileOrStdin

func StreamFileOrStdin(input []string, enc ...encoding.Encoding) (io.Reader, error)

StreamFileOrStdin reads file(s), or if there are none, reads frm stdin

func StreamGraph

func StreamGraph(ctx context.Context, file []string, interner ls.Interner, inputFormat string) (<-chan GraphStream, error)

func StreamJSONGraph

func StreamJSONGraph(ctx context.Context, file []string, interner ls.Interner) (<-chan GraphStream, error)

func StreamJSONLDGraph

func StreamJSONLDGraph(ctx context.Context, file []string, interner ls.Interner) (<-chan GraphStream, error)

func WriteGraph

func WriteGraph(cmd *cobra.Command, graph *lpg.Graph, format string, out io.Writer) error

func YAMLToMap

func YAMLToMap(in interface{}) interface{}

Types

type Config

type Config struct {
	IndexedProperties []string `json:"indexedProperties" yaml:"indexedProperties"`
}

func GetConfig

func GetConfig() Config

func LoadConfig

func LoadConfig(cmd *cobra.Command) (Config, error)

type GraphStream

type GraphStream struct {
	G   *lpg.Graph
	Err error
}

Jump to

Keyboard shortcuts

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