configuration

package
v0.0.0-...-3fbd50c Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2015 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package configuration has all the functions and structures required for the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheConfiguration

func CacheConfiguration()

CacheConfiguration method will cache the configuration file contents.

func GetShortCode

func GetShortCode() int64

GetShortCode method will return user credentails if available.

func QRCodeGenerate

func QRCodeGenerate(data, target string) error

QRCodeGenerate function will generate the QR Code for particular string

func SaveConfiguration

func SaveConfiguration() error

SaveConfiguration function will save the user credentials

func SaveIPDetailsConfig

func SaveIPDetailsConfig(iPDetailsConfig []IPDetails) error

SaveIPDetailsConfig function will save the user credentials

func SaveShortCode

func SaveShortCode(shortCode int64) error

SaveShortCode function will save the user credentials

func Zipit

func Zipit(source, target string, keepHierarchy bool) error

Zipit function will zip a folder

Types

type Configuration

type Configuration struct {
	//ShortCode for file uploads and downloads
	ShortCode int64
	//IPDetailsConfig array conatins the IPDetails
	IPDetailsConfig []IPDetails
}

Configuration has the required configuration variables

var (
	//ConfigurationLoaded will have the configuration of the application
	ConfigurationLoaded Configuration
)

type DownloadDetails

type DownloadDetails struct {
	//DownloadCode for the files.
	DownloadCode string
}

DownloadDetails structure for storing download file details.

type IPDetails

type IPDetails struct {
	//IPAddr holds the ipaddres
	IPAddr string
	//NWInterface holds the interface name
	NWInterface string
}

IPDetails has the interface and its corresponding ip

func GetIPDetailsConfig

func GetIPDetailsConfig() []IPDetails

GetIPDetailsConfig function will return user credentails if available.

type UploadDetails

type UploadDetails struct {
	//UploadFiles to store the files.
	UploadFiles []multipart.File
	//UploadFileNames to store the filenames.
	UploadFileNames []string
}

UploadDetails structure for storing the upload file details.

type UploadFileDetails

type UploadFileDetails struct {
	//ShortCode holds the shortcode for the download
	ShortCode string
	//IPDetailsConfig holds the IPDetails array
	IPDetailsConfig []IPDetails
}

UploadFileDetails structure has IPDetails array and Shortcode

Jump to

Keyboard shortcuts

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