lnksworks

package module
v0.0.0-...-f876671 Latest Latest
Warning

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

Go to latest
Published: May 29, 2019 License: MIT Imports: 21 Imported by: 0

README

lnkworks

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DbFormatColDelimSettings

func DbFormatColDelimSettings(coldelim ...string) (readsettings map[string]string)

func FindMimeTypeByExt

func FindMimeTypeByExt(ext string, defaultExt string) (mimetype string, extfound string)

FindMimeTypeByExt method that accepts ext [extension] and defaultext [default extension] and returns the appropriate mime type

func MapActiveCommand

func MapActiveCommand(path string, a ...interface{})

MapActiveCommand map a resource path to a list if ActiveCommandHandler(s) by command name e.g. lnksworks.MapActiveCommand("test/test.html",

	"testcommand", func(atvpros *lnksworks.ActiveProcessor, path string, a ...string) (err error) {
	atvpros.Out().Elem("span", func(out *widgeting.OutPrint, a ...interface{}) {
		out.Print("content in span")
	})
	return err
	},
)

func OutputResultSet

func OutputResultSet(w io.Writer, name string, contentext string, res *DbResultSet, err error, setting ...string)

OutputResultSet - helper method that output res *DbResultSet to the following formats into a io.Writer contentext=.js => javascript contentext=.json => json contentext=.csv => .csv

func ReaderToWriter

func ReaderToWriter(r io.Reader, w io.Writer, bufSize int)

ReaderToWriter conveniance method to write content from r io.Reader to w io.Writer using the indicated bufSize

func RegisterDbReadFormat

func RegisterDbReadFormat(formatname string, settings map[string]string, formatFunction func(map[string]string, *DbResultSet, io.Writer) error)

func RegisterEmbededResources

func RegisterEmbededResources(resources ...interface{})

RegisterEmbededResources RegisterEmbededResources Usage RegisterEmbededResources(string,io.Reader,string,io.Reader)

func RegisterRoute

func RegisterRoute(path string, rootpath string, hndlefunc ...func(svr *Server, rt *Route, root string, path string, mimetype string, w http.ResponseWriter, r *http.Request, active *ActiveProcessor))

RegisterRoute register logical pathed route path - logic path rootpath - physical path to e.g drive location hndlefunc overloaded func(svr *Server, rt *Route, root string, path string, mimetype string, w http.ResponseWriter, r *http.Request, active *ActiveProcessor)

Types

type ActiveAltOut

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

func (*ActiveAltOut) Close

func (atvAltOut *ActiveAltOut) Close()

func (*ActiveAltOut) IORW

func (atvAltOut *ActiveAltOut) IORW() *IORW

func (*ActiveAltOut) Print

func (atvAltOut *ActiveAltOut) Print(a ...interface{})

func (*ActiveAltOut) Println

func (atvAltOut *ActiveAltOut) Println(a ...interface{})

func (*ActiveAltOut) Read

func (altOut *ActiveAltOut) Read(p []byte) (n int, err error)

func (*ActiveAltOut) Seek

func (altOut *ActiveAltOut) Seek(offset int64, whence int) (n int64, err error)

func (*ActiveAltOut) Write

func (altOut *ActiveAltOut) Write(p []byte) (n int, err error)

type ActiveCommandHandler

type ActiveCommandHandler = func(atvpros *ActiveProcessor, path string, a ...string) error

ActiveCommandHandler definition of func that impliments the function that needs to be applied by the command mapped in MapActiveCommand

type ActiveDBConn

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

func (*ActiveDBConn) Begin

func (atvdbcn *ActiveDBConn) Begin() (tx driver.Tx, er error)

func (*ActiveDBConn) Close

func (atvdbcn *ActiveDBConn) Close() (err error)

func (*ActiveDBConn) Prepare

func (atvdbcn *ActiveDBConn) Prepare(query string) (stmnt driver.Stmt, err error)

type ActiveDBConnector

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

func (*ActiveDBConnector) Connect

func (atvdbcntr *ActiveDBConnector) Connect(cntx context.Context) (cn driver.Conn, err error)

func (*ActiveDBConnector) Driver

func (atvdbcntr *ActiveDBConnector) Driver() driver.Driver

type ActiveDBDriver

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

func (*ActiveDBDriver) Open

func (atvdbdrvr *ActiveDBDriver) Open(name string) (cn driver.Conn, err error)

func (*ActiveDBDriver) OpenConnector

func (atvdbdrvr *ActiveDBDriver) OpenConnector(name string) (cntr driver.Connector, err error)

type ActiveProcessor

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

ActiveProcessor - ActiveProcessor

func NewActiveProcessor

func NewActiveProcessor(w io.Writer) *ActiveProcessor

NewActiveProcessor new ActiveProcessor

func (*ActiveProcessor) AlternateOut

func (atvpros *ActiveProcessor) AlternateOut(name string, create ...bool) (atvaltout *ActiveAltOut)

func (*ActiveProcessor) Out

func (atvpros *ActiveProcessor) Out() *widgeting.OutPrint

Out current acive process out put handle

func (*ActiveProcessor) Parameters

func (atvpros *ActiveProcessor) Parameters() *Parameters

Parameters current active process Parameters container

func (*ActiveProcessor) Process

func (atvpros *ActiveProcessor) Process(rs io.ReadSeeker, root string, path string, retrieveRS RetrieveRSFunc, altlbls ...string) (err error)

Process main method that apply the active process rs - io.ReadSeeker of active content root - root path of rs path - path that active content can be found retrieveRS - func reference to a implementation base on RetrieveRSFunc definition

func (*ActiveProcessor) RemoveAlternateOut

func (atvpros *ActiveProcessor) RemoveAlternateOut(name string)

type Client

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

Client conveniance struct wrapping arround *http.Client, io.Writer -> io.Reader ...

func NewClient

func NewClient(r io.Reader, w io.Writer) (clnt *Client)

NewClient instantiate

func (*Client) CleanupClient

func (clnt *Client) CleanupClient()

CleanupClient cleanup Client instance

type ColumnType

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

ColumnType structure defining column definition

func (*ColumnType) DatabaseType

func (colType *ColumnType) DatabaseType() string

DatabaseType ColumnType underlying db type as defined by cnstring of DbConnection

func (*ColumnType) HasLength

func (colType *ColumnType) HasLength() bool

HasLength ColumnType content has Length definition

func (*ColumnType) HasNullable

func (colType *ColumnType) HasNullable() bool

HasNullable ColumnType content has NULL able content

func (*ColumnType) HasPrecisionScale

func (colType *ColumnType) HasPrecisionScale() bool

HasPrecisionScale ColumnType content has PrecisionScale

func (*ColumnType) Length

func (colType *ColumnType) Length() int64

Length ColumnType content lenth must be used in conjunction with HasLength

func (*ColumnType) Name

func (colType *ColumnType) Name() string

Name ColumnType.Name()

func (*ColumnType) Nullable

func (colType *ColumnType) Nullable() bool

Nullable ColumnType content is Nullable

func (*ColumnType) Numeric

func (colType *ColumnType) Numeric() bool

Numeric ColumnType is Numeric() bool

func (*ColumnType) Precision

func (colType *ColumnType) Precision() int64

Precision ColumnType numeric Precision. Used in conjunction with HasPrecisionScale

func (*ColumnType) Scale

func (colType *ColumnType) Scale() int64

Scale ColumnType Scale. Used in conjunction with HasPrecisionScale

func (*ColumnType) Type

func (colType *ColumnType) Type() reflect.Type

Type ColumnType reflect.Type as specified by golang sql/database

type DBExecuted

type DBExecuted struct {
	LastInsertId int64
	RowsAffected int64
	Err          error
}

DBExecuted controller

type DBQuery

type DBQuery struct {
	RSet *DbResultSet

	Err error
	// contains filtered or unexported fields
}

DBQuery DBQuery controller

func (*DBQuery) Data

func (dbqry *DBQuery) Data() []interface{}

Data returns an array if data of the current row from the underlying resultset

func (*DBQuery) MetaData

func (dbqry *DBQuery) MetaData() *DbResultSetMetaData

MetaData return a DbResultSetMetaData object of the resultset that is wrapped by this DBQuery controller

func (*DBQuery) Next

func (dbqry *DBQuery) Next() bool

Next execute the Next record method of the underlying resultset

func (*DBQuery) PrintResult

func (dbqry *DBQuery) PrintResult(out *IORW, name string, contentext string, setting ...string)

PrintResult [refer to OutputResultSet] - helper method that output res *DbResultSet to the following formats into a io.Writer contentext=.js => javascript contentext=.json => json contentext=.csv => .csv

func (*DBQuery) Process

func (dbqry *DBQuery) Process() (err error)

Process reading Columns then reading rows one by one till eof and finally indicate done processing

func (*DBQuery) ReadAll

func (dbqry *DBQuery) ReadAll(w io.Writer, format string)

func (*DBQuery) ReadAllCustom

func (dbqry *DBQuery) ReadAllCustom(w io.Writer, settings map[string]string, formatFunction func(map[string]string, *DbResultSet, io.Writer) error)

type DbConnection

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

DbConnection DbConnection controller

func (*DbConnection) Execute

func (cn *DbConnection) Execute(query string, args ...interface{}) (lastInsertID int64, rowsAffected int64, err error)

Execute - Execute (query) refer to golang sql connection Execute method

func (*DbConnection) ParseQuery

func (cn *DbConnection) ParseQuery(query string) (parsedquery string, params []string)

ParseQuery parse query and return parsed query based on db connection type and list of paramnames query e.g 'SELECT :TEST-PARAM AS param' where :TEST-PARAM is name of parameter

func (*DbConnection) Query

func (cn *DbConnection) Query(query string, args ...interface{}) (rset *DbResultSet, err error)

Query - Query (query) refer to golang sql connection Query method except that it returns and DbResultSet that extends standard resultset functionality

type DbManager

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

DbManager DbManager controller

func DatabaseManager

func DatabaseManager() *DbManager

DatabaseManager global instance of DbManager

func (*DbManager) Connection

func (dbmngr *DbManager) Connection(alias string) (cn *DbConnection)

Connection returns aliased DbConnection

func (*DbManager) Execute

func (dbmngr *DbManager) Execute(alias string, query string, args ...interface{}) (dbexecuted *DBExecuted)

Execute execute query for alias connection return a DbExecute controller that represents the outcome of the executed request

func (*DbManager) Open

func (dbmngr *DbManager) Open(alias string, driver string, datasourcename string) (cn *DbConnection, err error)

Open - open a db connection based and register aliased reference to it in the DbManager returns a DbConnnection controller of the connection

func (*DbManager) Query

func (dbmngr *DbManager) Query(alias string, query string, args ...interface{}) (dbquery *DBQuery)

Query query aliased connection and returns a DBQuery controller for the underlying resultset

func (*DbManager) RegisterConnection

func (dbmngr *DbManager) RegisterConnection(alias string, driver string, datasourcename string) (err error)

RegisterConnection a db connection refer to DbManager.Open

type DbResultSet

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

DbResultSet DbResultSet container

func (*DbResultSet) Close

func (rset *DbResultSet) Close() (err error)

Close the DbResultSet as well as the underlying DbStatement related to this DbResultSet After this action the DbResultSet is 'empty' or cleaned up in a golang world

func (*DbResultSet) Data

func (rset *DbResultSet) Data() []interface{}

Data return Displayable data in the form of a slice, 'array', of interface{} values

func (*DbResultSet) MetaData

func (rset *DbResultSet) MetaData() *DbResultSetMetaData

MetaData DbResultSet=>DbResultSetMetaData

func (*DbResultSet) Next

func (rset *DbResultSet) Next() (next bool, err error)

Next return true if able to move focus of DbResultSet to the next underlying record or false if the end is reached

type DbResultSetMetaData

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

DbResultSetMetaData DbResultSet meta data container

func (*DbResultSetMetaData) ColumnTypes

func (rsetmeta *DbResultSetMetaData) ColumnTypes() []*ColumnType

ColumnTypes ColumnType(s) definition(s)

func (*DbResultSetMetaData) Columns

func (rsetmeta *DbResultSetMetaData) Columns() []string

Columns column name(s)

type DbStatement

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

DbStatement container representing the underlying DbConnection and allocated sql.Tx transaction

func NewDbStatement

func NewDbStatement(cn *DbConnection) (stmnt *DbStatement, err error)

NewDbStatement invoke a new DbStatement from the DbConnection

func (*DbStatement) Begin

func (stmnt *DbStatement) Begin() (err error)

Begin Invoke a transaction, sql.Tx, from the for ths DbStatement

func (*DbStatement) Close

func (stmnt *DbStatement) Close() (err error)

Close the allocated transaction, sql.Tx associated to this DbStatement It will by default perform a commit before releasing the transaction reference

func (*DbStatement) Execute

func (stmnt *DbStatement) Execute(query string, args ...interface{}) (lastInsertID int64, rowsAffected int64, err error)

Execute execute a none DbResultSet query Usually used for statement like update and insert, or executing db procedures that dont return a record In the case of Insert or Update if the underlying db driver return the lastInsertID and rowsAffected if supported

func (*DbStatement) Query

func (stmnt *DbStatement) Query(query string, args ...interface{}) (rset *DbResultSet, err error)

Query and return a DbResultSet

type EmbededResource

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

EmbededResource struct representing embeded resource

type Exception

type Exception interface{}

Exception interface

type Header map[string][]string

Header core Header map

func (Header) Append

func (hdr Header) Append(name string, value ...string)

Append values(s)

func (Header) ContainsKey

func (hdr Header) ContainsKey(key string) (keyok bool)

ContainsKey check if Header ContainsKey

func (Header) Keys

func (hdr Header) Keys() (keys []string)

Keys []string of keys

func (Header) SetValue

func (hdr Header) SetValue(name string, value ...string)

SetValue Header

func (Header) Value

func (hdr Header) Value(name string) []string

Value Header

func (Header) Values

func (hdr Header) Values(name ...string) (values [][]string)

Values [][]string values

type IORW

type IORW struct {

	//altCloser      io.Closer
	//altReaderLock  *sync.Mutex
	//altReadSeeker  io.ReadSeeker
	//altWriter      io.Writer
	//altWriterLock  *sync.Mutex
	//altWriteSeeker io.WriteSeeker
	io.Reader
	io.Writer
	io.ReadSeeker
	io.WriteSeeker
	// contains filtered or unexported fields
}

IORW Reader Writer

func EmbededResourceByPath

func EmbededResourceByPath(respath string) (resio *IORW)

EmbededResourceByPath return EmbededResource by path note return resio *IORW

func NewIORW

func NewIORW(a ...interface{}) (ioRW *IORW, err error)

NewIORW invoke new instance of IORW

func (*IORW) BufferSize

func (ioRW *IORW) BufferSize() (bufsize int64)

BufferSize only buffer size of IORW Content

func (*IORW) ClearBuffer

func (ioRW *IORW) ClearBuffer()

ClearBuffer clear internal memory buffer of IORW and cleanup internal ReadWriteCursor

func (*IORW) Close

func (ioRW *IORW) Close() (err error)

Close or cleanup IORW

func (*IORW) Empty

func (ioRW *IORW) Empty() bool

Empty -> indicate if IORW is empty

func (*IORW) FileInfo

func (ioRW *IORW) FileInfo() os.FileInfo

FileInfo return the os.FileInfo of the underlying file that the IO wraps arround

func (*IORW) HasPrefix

func (ioRW *IORW) HasPrefix(prefix []byte) bool

HasPrefix indicate if the IORW internal content starts with the indicated []byte prefix

func (*IORW) HasPrefixExp

func (ioRW *IORW) HasPrefixExp(regexp *regexp.Regexp) bool

HasPrefixExp indicate of the IORW underlying content start with the specified regexp

func (*IORW) HasPrefixSuffix

func (ioRW *IORW) HasPrefixSuffix(prefix []byte, suffix []byte) bool

HasPrefixSuffix indicate if the IORW internal content starts with the indicated []byte prefix and ends with the indicated []byte suffix

func (*IORW) HasSuffix

func (ioRW *IORW) HasSuffix(suffix []byte) bool

HasSuffix indicate if the IORW internal content emd with the indicated []byte suffix

func (*IORW) MatchExp

func (ioRW *IORW) MatchExp(regexpa ...interface{}) bool

MatchExp Indicate if the content match the one or more regexp(s) If mor than one regexp, *regexp.Regexp, is passed it will test the regexp(s) in order

func (*IORW) NonBufferSize

func (ioRW *IORW) NonBufferSize() (nonsize int64)

NonBufferSize Size of IORW Content excluding the buffer

func (*IORW) Print

func (ioRW *IORW) Print(a ...interface{}) (n int, err error)

Print -. conveniant method that works the same as fmt.Fprint but writing to IORW

func (*IORW) Println

func (ioRW *IORW) Println(a ...interface{}) (n int, err error)

Println -. conveniant method that works the same as fmt.Fprintln but writing to IORW

func (*IORW) Read

func (ioRW *IORW) Read(p []byte) (n int, err error)

Read into b []byte n amount of bytes from IORW

func (*IORW) ReadAll

func (ioRW *IORW) ReadAll(w io.Writer) (err error)

ReadAll content from IORW into w io.Writer

func (*IORW) ReadAllToHandle

func (ioRW *IORW) ReadAllToHandle(hndle func([]byte) (int, error)) (err error)

ReadAllToHandle perform same action as ReadAll just calling a custom handle as an output (write) caller

func (*IORW) ReadRune

func (ioRW *IORW) ReadRune() (r rune, size int, err error)

ReadRune implements the io.RuneReader interface.

func (*IORW) ReadWriteCursor

func (ioRW *IORW) ReadWriteCursor(enableLocking bool) (ioRWCur *ReadWriteCursor)

ReadWriteCursor create a cursor instance to handle Read operations in multi session environments

func (*IORW) Seek

func (ioRW *IORW) Seek(offset int64, whence int) (n int64, err error)

Seek -> refer to io.ReadSeeker go documentation

func (*IORW) SeekIndex

func (ioRW *IORW) SeekIndex() int64

SeekIndex last seekedIndex

func (*IORW) Size

func (ioRW *IORW) Size() (size int64)

Size actual size of IORW Content

func (*IORW) String

func (ioRW *IORW) String() (s string)

String allow for any IORW instance to be printed e.g fmt.Fprint

func (*IORW) UnderlyingCursor

func (ioRW *IORW) UnderlyingCursor() *ReadWriteCursor

UnderlyingCursor internal, underlying, ReadWriteCursor of IORW for internal IO operations

func (*IORW) Write

func (ioRW *IORW) Write(p []byte) (n int, err error)

Write b []byte n amount of bytes into IORW

func (*IORW) WriteAll

func (ioRW *IORW) WriteAll(r io.Reader, maxReadLen ...int64) (err error)

WriteAll content from r io.Reader

func (*IORW) WriteRune

func (ioRW *IORW) WriteRune(r rune) (int, error)

WriteRune r rune into IORW as bytes

type IOSeekReader

type IOSeekReader struct {
	*Seeker
	// contains filtered or unexported fields
}

IOSeekReader extends Seeker and wraps arround a io.ReaderSeeker

func NewIOSeekReader

func NewIOSeekReader(ioRS io.ReadSeeker) *IOSeekReader

NewIOSeekReader invoke instance of *IOSeekReader that wrap arround an ioRS io.ReadSeeker

func (*IOSeekReader) ClearIOSeekReader

func (iosr *IOSeekReader) ClearIOSeekReader()

ClearIOSeekReader clear IOSeekReader

func (*IOSeekReader) Empty

func (iosr *IOSeekReader) Empty() bool

Empty indicate if any seek pos start end posistion list is empty

func (*IOSeekReader) Read

func (iosr *IOSeekReader) Read(p []byte) (n int, err error)

func (*IOSeekReader) Size

func (iosr *IOSeekReader) Size() int

Size size or length of the seek pos sart end posistion list

func (*IOSeekReader) StringSeekPos

func (iosr *IOSeekReader) StringSeekPos(pos int, bufsize int) (s string, err error)

StringSeekPos return s string value of pos, index, of point[starti,endi]

func (*IOSeekReader) WriteSeekedPos

func (iosr *IOSeekReader) WriteSeekedPos(w io.Writer, pos int, bufsize int) (err error)

WriteSeekedPos write content of pos, index, of point[starti,endi] into w io.Writer

type IOSeekReaderInput

type IOSeekReaderInput interface {
	ReadSeekedIndex(int, int, []byte) int64
	ReadSeekedPos(int, []byte) (int, error)
}

IOSeekReaderInput IOSeekReader input interface

type IOSeekReaderOutput

type IOSeekReaderOutput interface {
	SeekOutput
	WriteSeekedPos(io.Writer, int, int) error
}

IOSeekReaderOutput IOSeekReader output interface

type Parameters

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

Parameters -> structure containing parameters

func NewParameters

func NewParameters() *Parameters

NewParameters return new instance of Paramaters container

func (*Parameters) CleanupParameters

func (params *Parameters) CleanupParameters()

CleanupParameters function that can be called to assist in cleaning up instance of Parameter container

func (*Parameters) ContainsFileParameter

func (params *Parameters) ContainsFileParameter(pname string) bool

ContainsFileParameter -> check if file parameter exist pname : name

func (*Parameters) ContainsParameter

func (params *Parameters) ContainsParameter(pname string) bool

ContainsParameter -> check if parameter exist pname : name

func (*Parameters) FileKeys

func (params *Parameters) FileKeys() (keys []string)

FileKeys - list of file parameters names (keys)

func (*Parameters) FileParameter

func (params *Parameters) FileParameter(pname string) []interface{}

FileParameter return file paramater - array of file

func (*Parameters) Parameter

func (params *Parameters) Parameter(pname string) []string

Parameter - return a specific parameter values

func (*Parameters) SetFileParameter

func (params *Parameters) SetFileParameter(pname string, clear bool, pfile ...interface{})

SetFileParameter -> set or append file parameter value pname : name pfile : value of interface to add either FileHeader from mime/multipart or any io.Reader implementation clear : clear existing value of parameter

func (*Parameters) SetParameter

func (params *Parameters) SetParameter(pname string, clear bool, pvalue ...string)

SetParameter -> set or append parameter value pname : name pvalue : value of strings to add clear : clear existing value of parameter

func (*Parameters) StandardKeys

func (params *Parameters) StandardKeys() (keys []string)

StandardKeys - list of standard parameters names (keys)

func (*Parameters) StringParameter

func (params *Parameters) StringParameter(pname string, sep string) string

StringParameter return parameter as string concatenated with sep

type ProcessingFunc

type ProcessingFunc = func(dbqry *DBQuery, stage QueryStage, a ...interface{})

ProcessingFunc definition

type QueryStage

type QueryStage int

QueryStage stage

func (QueryStage) String

func (qrystage QueryStage) String() (s string)

type ReadColumnsFunc

type ReadColumnsFunc = func(dbqry *DBQuery, columns []string, columntypes []*ColumnType)

ReadColumnsFunc definition

type ReadRowFunc

type ReadRowFunc = func(dbqry *DBQuery, data []interface{}, firstRec bool, lastRec bool)

ReadRowFunc definition

type ReadWriteCursor

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

ReadWriteCursor cursor for IORW

func (*ReadWriteCursor) Close

func (ioRWCur *ReadWriteCursor) Close() (err error)

Close refer to io.ReaderClose in golang docs

func (*ReadWriteCursor) FileInfo

func (ioRWCur *ReadWriteCursor) FileInfo() os.FileInfo

FileInfo fileinfo

func (*ReadWriteCursor) Read

func (ioRWCur *ReadWriteCursor) Read(p []byte) (n int, err error)

func (*ReadWriteCursor) ReadAll

func (ioRWCur *ReadWriteCursor) ReadAll(w io.Writer) (err error)

ReadAll content from BhReaderWriterCursor into w io.Writer

func (*ReadWriteCursor) ReadAllToHandle

func (ioRWCur *ReadWriteCursor) ReadAllToHandle(hndle func([]byte) (int, error)) (err error)

ReadAllToHandle perform same action as ReaadAll just calling a custom handle as an ouput (write) caller

func (*ReadWriteCursor) ReadRune

func (ioRWCur *ReadWriteCursor) ReadRune() (r rune, size int, err error)

ReadRune implements the io.RuneReader interface.

func (*ReadWriteCursor) Seek

func (ioRWCur *ReadWriteCursor) Seek(offset int64, whence int) (n int64, err error)

Seek -> refer to io.Seeker golang docs offset to seek from whence -> 0 == From Start whence -> 1 == From Current Offset index whence -> 2 == From End

func (*ReadWriteCursor) SeekIndex

func (ioRWCur *ReadWriteCursor) SeekIndex() int64

SeekIndex last seekindex of ReadWriteCursor

func (*ReadWriteCursor) String

func (ioRWCur *ReadWriteCursor) String() (s string)

String

type RequestContent

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

RequestContent Client RequestContent

type RequestHeader

type RequestHeader struct {
	*Header
	// contains filtered or unexported fields
}

RequestHeader request Header

func (*RequestHeader) Client

func (reqHdr *RequestHeader) Client() *Client

Client public Client method for RequestHeader

func (*RequestHeader) ReadAll

func (reqHdr *RequestHeader) ReadAll(r io.Reader, keyvalsep string, headersep string) (err error)

ReadAll method to populate (write) RequestHeader from io.Reader

type ResponseContent

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

ResponseContent Client ResponseContent

type ResponseHeader

type ResponseHeader struct {
	*Header
	// contains filtered or unexported fields
}

ResponseHeader response Header

func (*ResponseHeader) Client

func (respHdr *ResponseHeader) Client() *Client

Client public Client method for ResponseHeader

func (*ResponseHeader) ReadAll

func (respHdr *ResponseHeader) ReadAll(r io.Reader, keyvalsep string, headersep string) (err error)

ReadAll method to populate (write) ResponseHeader from io.Reader

type RetrieveRSFunc

type RetrieveRSFunc = func(root string, path string) (rsfound io.ReadSeeker, rsfounderr error)

RetrieveRSFunc definition if function that retrieve external active resource e.g file

type Route

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

Route struct of Route

func (*Route) ServeContent

func (rt *Route) ServeContent(path string, w http.ResponseWriter, r *http.Request, active *ActiveProcessor, retrievedRs map[string]io.ReadSeeker)

ServeContent that invoke mapped hndlefunc -> func(svr *Server, rt *Route, root string, path string, mimetype string, w http.ResponseWriter, r *http.Request, active *ActiveProcessor)

type Router

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

Router struct mapping Route(s)

type SeekOutput

type SeekOutput interface {
	Append(int64, int64)
}

SeekOutput interface

type Seeker

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

Seeker base struct implementation of SeekOutput

func (*Seeker) Append

func (sker *Seeker) Append(starti int64, endi int64)

Append Seeker appends starti, endi

func (*Seeker) ClearSeeker

func (sker *Seeker) ClearSeeker()

ClearSeeker clear seeker starti,endi points

func (*Seeker) Empty

func (sker *Seeker) Empty() bool

Empty Seeker

type Server

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

Server conveniance struct wrapping arround *http.Server

func NewServer

func NewServer(port string, istls bool, certFile string, keyFile string) *Server

NewServer return *Server istls is tls listener certfile string - path to certificate file keyFile string - path to key file

func (*Server) Listen

func (svr *Server) Listen() (err error)

Listen start listening for connection(s)

func (*Server) ServeHTTP

func (svr *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP server http.Handler interface implementation of ServeHTTP

type Service

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

Service struct

func NewService

func NewService(name string, displayName string, description string, start func(*Service, ...string),
	run func(*Service, ...string),
	stop func(*Service, ...string)) (svr *Service, err error)

NewService invoke new *Service name - ServiceName displayName - ServiceDisplayName description - ServiceDescription start - func(*Service, ...string) implementation, gets invoked when Service Start run - func(*Service, ...string) implementation, gets invoked when Service Run stop - func(*Service, ...string) implementation, gets invoked when Service Stop

func (*Service) Execute

func (svr *Service) Execute(args []string) (err error)

Execute main Service Execute method when executing Service called in main() func of golang app, args - args from os gets passed into here

func (*Service) IsConsole

func (svr *Service) IsConsole() bool

IsConsole Service

func (*Service) IsService

func (svr *Service) IsService() bool

IsService Service

func (*Service) ServiceDescription

func (svr *Service) ServiceDescription() string

ServiceDescription Service Description

func (*Service) ServiceDisplayName

func (svr *Service) ServiceDisplayName() string

ServiceDisplayName Service Display Name

func (*Service) ServiceExeFolder

func (svr *Service) ServiceExeFolder() string

ServiceExeFolder local folder where Service Executable resides

func (*Service) ServiceExeName

func (svr *Service) ServiceExeName() string

ServiceExeName Service Executable Name

func (*Service) ServiceName

func (svr *Service) ServiceName() string

ServiceName Service Name

func (*Service) Start

func (svr *Service) Start(s service.Service) error

Start Service

func (*Service) Stop

func (svr *Service) Stop(s service.Service) error

Stop Service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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