Versions in this module Expand all Collapse all v0 v0.1.0 Feb 21, 2018 Changes in this version + const CSVMimeType + const JSONMimeType + const MethodDelete + const MethodGet + const MethodHead + const MethodOptions + const MethodPatch + const MethodPost + const MethodPut + const MethodTrace + const TSVMimeType + const TextMimeType + var CopyStringValueProvider = func(source string) string + var DateFormatKeyword = "dateFormat" + var DateLayoutKeyword = "dateLayout" + var DefaultDateLayout = "2006-01-02 15:04:05.000" + var DefaultDecoderFactory = NewJSONDecoderFactory() + var DefaultEncoderFactory = NewJSONEncoderFactory() + var FileExtensionMimeType = map[string]string + var FileSchema = "file://" + var TrueProvider = func(input interface{}) bool + var TrueValueProvider = func(ignore interface{}) bool + func AsBoolean(value interface{}) bool + func AsCompatibleFunctionParameters(function interface{}, parameters []interface{}) ([]interface{}, error) + func AsFloat(value interface{}) float64 + func AsInt(value interface{}) int + func AsJSONText(source interface{}) (string, error) + func AsMap(source interface{}) map[string]interface + func AsSlice(sourceSlice interface{}) []interface + func AsString(input interface{}) string + func AsTime(value interface{}, dateLayout string) *time.Time + func AssertKind(input interface{}, kind reflect.Kind, name string) + func AssertPointerKind(input interface{}, kind reflect.Kind, name string) + func AssertTypeKind(dataType reflect.Type, kind reflect.Kind, name string) + func BuildFunctionParameters(function interface{}, parameters []string, ...) ([]interface{}, error) + func BuildTagMapping(structTemplatePointer interface{}, mappedKeyTag string, ...) map[string](map[string]string) + func CallFunction(function interface{}, parameters ...interface{}) []interface + func CallerDirectory(callerIndex int) string + func CallerInfo(callerIndex int) (string, string, int) + func CanConvertToFloat(value interface{}) bool + func CanConvertToInt(value interface{}) bool + func CanConvertToString(input interface{}) bool + func CopyMapEntries(sourceMap, targetMap interface{}) + func CopySliceElements(sourceSlice, targetSlicePointer interface{}) + func CopyWithBufferPool(source io.Reader, destination io.Writer, pool httputil.BufferPool) (int64, error) + func CountPointers(value interface{}) int + func CreateDirIfNotExist(dirs ...string) error + func DateFormatToLayout(dateFormat string) string + func DereferenceType(value interface{}) reflect.Type + func DereferenceValue(value interface{}) interface + func DereferenceValues(source interface{}) interface + func DiscoverCollectionValuesAndKind(values interface{}) ([]interface{}, reflect.Kind) + func DiscoverComponentType(input interface{}) reflect.Type + func DiscoverTypeByKind(input interface{}, expected reflect.Kind) reflect.Type + func DiscoverValueAndKind(input string) (interface{}, reflect.Kind) + func DiscoverValueByKind(input interface{}, expected reflect.Kind) reflect.Value + func ExpandFileTemplate(template string) string + func ExpandParameters(macroEvaluator *MacroEvaluator, parameters map[string]string) error + func ExpandValue(macroEvaluator *MacroEvaluator, value string) (string, error) + func ExtractMimeType(file string) string + func ExtractURIParameters(templateURI, requestURI string) (map[string]string, bool) + func FileExists(filename string) bool + func FileFromURL(fileURL string) (string, error) + func FilterSliceElements(sourceSlice interface{}, predicate interface{}, targetSlicePointer interface{}) + func GetFuncSignature(function interface{}) []reflect.Type + func GetFunction(owner interface{}, name string) (interface{}, error) + func GetSliceValue(slice interface{}, index int) interface + func GetTimeLayout(settings map[string]string) string + func GroupSliceElements(sourceSlice, targetMap, keyFunction interface{}) + func HasSliceAnyElements(sourceSlice interface{}, elements ...interface{}) (result bool) + func HasTimeLayout(settings map[string]string) bool + func IndexSlice(slice, resultingMap, keyFunction interface{}) + func InitStruct(source interface{}) + func IsASCIIText(candidate string) bool + func IsBool(input interface{}) bool + func IsCompleteJSON(candidate string) bool + func IsFloat(input interface{}) bool + func IsFunc(input interface{}) bool + func IsInt(input interface{}) bool + func IsMap(input interface{}) bool + func IsNewLineDelimitedJSON(candidate string) bool + func IsPointer(input interface{}) bool + func IsSlice(input interface{}) bool + func IsString(input interface{}) bool + func IsStruct(input interface{}) bool + func IsTime(input interface{}) bool + func IsValueOfKind(input interface{}, kind reflect.Kind) bool + func IsZero(input interface{}) bool + func JSONToInterface(source interface{}) (interface{}, error) + func JSONToMap(source interface{}) (map[string]interface{}, error) + func JSONToSlice(source interface{}) ([]interface{}, error) + func JoinAsString(slice interface{}, separator string) string + func LoadConfigFromUrl(url string, config interface{}) error + func MakeReverseStringMap(text string, valueSepartor string, itemSeparator string) map[string]string + func MakeStringMap(text string, valueSepartor string, itemSeparator string) map[string]string + func MapKeysToSlice(sourceMap interface{}, targetSlicePointer interface{}) + func MapKeysToStringSlice(sourceMap interface{}) []string + func NewBytes(input []byte) []byte + func NewBytesBufferPool(poolSize, bufferSize int) httputil.BufferPool + func NewFieldSettingByKey(aStruct interface{}, key string) map[string](map[string]string) + func NewHttpClient(options ...*HttpOptions) (*http.Client, error) + func NewLineDelimitedJSON(candidate string) ([]interface{}, error) + func OpenFile(filename string) (*os.File, error) + func OpenReaderFromURL(rawURL string) (io.ReadCloser, string, error) + func OpenURL(fileURL string, flag int, permissions os.FileMode) (*os.File, error) + func ParseTime(input, layout string) (time.Time, error) + func Process2DSliceInBatches(slice [][]interface{}, size int, handler func(batchedSlice [][]interface{})) + func ProcessMap(sourceMap interface{}, handler func(key, value interface{}) bool) + func ProcessSlice(slice interface{}, handler func(item interface{}) bool) + func ProcessSliceWithIndex(slice interface{}, handler func(index int, item interface{}) bool) + func ProcessStruct(aStruct interface{}, ...) error + func QueryBoolValue(u *url.URL, name string, defaultValue bool) bool + func QueryIntValue(u *url.URL, name string, defaultValue int) int + func QueryValue(u *url.URL, name, defaultValue string) string + func RemoveFileIfExist(filenames ...string) error + func ReverseSlice(source interface{}) + func RouteToService(method, url string, request, response interface{}) (err error) + func SetSliceValue(slice interface{}, index int, value interface{}) + func SliceToMap(sourceSlice, targetMap, keyFunction, valueFunction interface{}) + func SliceToMultimap(sourceSlice, targetMap, keyFunction, valueFunction interface{}) + func SortStrings(source []string) []string + func TimestampToString(dateFormat string, unixTimestamp, unixNanoTimestamp int64) string + func ToFloat(value interface{}) (float64, error) + func ToInt(value interface{}) (int, error) + func ToTime(value interface{}, dateLayout string) (*time.Time, error) + func TransformSlice(sourceSlice, targetSlicePointer, transformer interface{}) + func URLBase(URL string) string + func URLPathJoin(baseURL, path string) string + func URLSplit(URL string) (string, string) + func UnwrapValue(value *reflect.Value) interface + func WriteServiceRoutingResponse(response http.ResponseWriter, request *http.Request, ...) error + type BatchLimiter struct + Mutex *sync.RWMutex + func NewBatchLimiter(batchSize, total int) *BatchLimiter + func (r *BatchLimiter) Acquire() + func (r *BatchLimiter) Done() + func (r *BatchLimiter) Wait() + type BodyMatcher struct + Begin string + End string + func (m BodyMatcher) Match(input string, offset int) (matched int) + type ByteWriterAt struct + Buffer []byte + func NewByteWriterAt() *ByteWriterAt + func (w *ByteWriterAt) WriteAt(p []byte, offset int64) (n int, err error) + type CharactersMatcher struct + Chars string + func (m CharactersMatcher) Match(input string, offset int) (matched int) + type Context interface + Clone func() Context + Contains func(targetType interface{}) bool + GetInto func(targetType interface{}, target interface{}) bool + GetOptional func(targetType interface{}) interface{} + GetRequired func(targetType interface{}) (interface{}, error) + Put func(targetType interface{}, value interface{}) error + Remove func(targetType interface{}) interface{} + Replace func(targetType interface{}, value interface{}) error + func NewContext() Context + type Converter struct + DateLayout string + MappedKeyTag string + func NewColumnConverter(dateLayout string) *Converter + func (c *Converter) AssignConverted(target, source interface{}) error + type Decoder interface + Decode func(v interface{}) error + type DecoderFactory interface + Create func(reader io.Reader) Decoder + func NewDelimiterDecoderFactory() DecoderFactory + func NewJSONDecoderFactory() DecoderFactory + func NewJSONDecoderFactoryWithOption(useNumber bool) DecoderFactory + func NewUnMarshalerDecoderFactory() DecoderFactory + func NewYamlDecoderFactory() DecoderFactory + type DelimitedRecord struct + Columns []string + Delimiter string + Record map[string]interface{} + func (r *DelimitedRecord) IsEmpty() bool + type Dictionary interface + Exists func(key string) bool + Get func(key string) (interface{}, error) + type EOFMatcher struct + func (m EOFMatcher) Match(input string, offset int) (matched int) + type Encoder interface + Encode func(object interface{}) error + type EncoderFactory interface + Create func(writer io.Writer) Encoder + func NewJSONEncoderFactory() EncoderFactory + func NewMarshalerEncoderFactory() EncoderFactory + func NewYamlEncoderFactory() EncoderFactory + type FieldInfo struct + Comment string + IsChannel bool + IsMap bool + IsPointer bool + IsSlice bool + IsStruct bool + KeyTypeName string + Name string + Tag string + TypeName string + TypePackage string + ValueTypeName string + func NewFieldInfo(field *ast.Field) *FieldInfo + type FileInfo struct + func NewFileInfo(basePath, packageName, filename string, fileSet *token.FileSet) *FileInfo + func (f *FileInfo) HasStructInfo(name string) bool + func (f *FileInfo) Struct(name string) *StructInfo + func (f *FileInfo) Structs() []*StructInfo + func (v *FileInfo) Visit(node ast.Node) ast.Visitor + type FileLogger struct + func NewFileLogger(configs ...FileLoggerConfig) (*FileLogger, error) + func (l *FileLogger) Log(message *LogMessage) error + func (l *FileLogger) NewLogStream(path string, config *FileLoggerConfig) (*LogStream, error) + func (l *FileLogger) Notify(siginal os.Signal) + type FileLoggerConfig struct + FileTemplate string + FlushFrequencyInMs int + FlushRequencyInMs int + LogType string + MaxIddleTimeInSec int + MaxQueueSize int + QueueFlashCount int + func (c *FileLoggerConfig) Validate() error + type FileSetInfo struct + func NewFileSetInfo(baseDir string) (*FileSetInfo, error) + func (f *FileSetInfo) FileInfo(name string) *FileInfo + func (f *FileSetInfo) FilesInfo() map[string]*FileInfo + func (f *FileSetInfo) Struct(name string) *StructInfo + type FunctionInfo struct + Name string + ParameterFields []*FieldInfo + ReceiverTypeName string + ResultsFields []*FieldInfo + func NewFunctionInfo(funcDeclaration *ast.FuncDecl) *FunctionInfo + type HandlerInvoker func(serviceRouting *ServiceRouting, request *http.Request, ...) error + type HttpOptions struct + Key string + Value interface{} + type IdMatcher struct + func (m IdMatcher) Match(input string, offset int) (matched int) + type IntMatcher struct + func (m IntMatcher) Match(input string, offset int) (matched int) + type Iterator interface + HasNext func() bool + Next func(itemPointer interface{}) error + func NewSliceIterator(slice interface{}) Iterator + type KeywordMatcher struct + CaseSensitive bool + Keyword string + func (m KeywordMatcher) Match(input string, offset int) (matched int) + type KeywordsMatcher struct + CaseSensitive bool + Keywords []string + func (m KeywordsMatcher) Match(input string, offset int) (matched int) + type LiteralMatcher struct + func (m LiteralMatcher) Match(input string, offset int) (matched int) + type LogMessage struct + Message interface{} + MessageType string + type LogMessages struct + Messages []LogMessage + type LogStream struct + Complete chan bool + Config *FileLoggerConfig + File *os.File + LastAddQueueTime time.Time + LastWriteTime uint64 + Logger *FileLogger + Messages chan string + Name string + RecordCount int + func (s *LogStream) Close() + func (s *LogStream) Log(message *LogMessage) error + type MacroEvaluator struct + Postfix string + Prefix string + ValueProviderRegistry ValueProviderRegistry + func NewMacroEvaluator(prefix, postfix string, registry ValueProviderRegistry) *MacroEvaluator + func (e *MacroEvaluator) Expand(context Context, input string) (interface{}, error) + func (e *MacroEvaluator) HasMacro(candidate string) bool + type MapDictionary map[string]interface + func (d *MapDictionary) Exists(name string) bool + func (d *MapDictionary) Get(name string) (interface{}, error) + type Marshaler interface + Marshal func() (data []byte, err error) + type Matcher interface + Match func(input string, offset int) (matched int) + type Predicate interface + Apply func(value interface{}) bool + func NewBetweenPredicate(from, to interface{}) Predicate + func NewComparablePredicate(operator string, leftOperand interface{}) Predicate + func NewInPredicate(values ...interface{}) Predicate + func NewLikePredicate(matching string) Predicate + func NewNilPredicate() Predicate + func NewWithinPredicate(baseTime time.Time, deltaInSeconds int, dateLayout string) Predicate + type ServiceRouter struct + func NewServiceRouter(serviceRouting ...ServiceRouting) *ServiceRouter + func (r *ServiceRouter) Route(response http.ResponseWriter, request *http.Request) error + func (r *ServiceRouter) WriteResponse(encoderFactory EncoderFactory, response interface{}, request *http.Request, ...) error + type ServiceRouting struct + ContentTypeDecoders map[string]DecoderFactory + ContentTypeEncoders map[string]EncoderFactory + HTTPMethod string + Handler interface{} + HandlerInvoker HandlerInvoker + Parameters []string + URI string + type StatusCodeSettable interface + SetStatusCode func(code int) + type StructFieldMeta struct + Description string + Name string + Required bool + Type string + type StructInfo struct + Comment string + FileName string + Name string + Package string + Settings map[string]string + func NewStructInfo(name string) *StructInfo + func (s *StructInfo) AddFields(fields ...*FieldInfo) + func (s *StructInfo) AddReceivers(receivers ...*FunctionInfo) + func (s *StructInfo) Field(name string) *FieldInfo + func (s *StructInfo) Fields() []*FieldInfo + func (s *StructInfo) HasField(name string) bool + func (s *StructInfo) HasReceiver(name string) bool + func (s *StructInfo) Receiver(name string) *FunctionInfo + func (s *StructInfo) Receivers() []*FunctionInfo + type StructMeta struct + Dependencies []*StructMeta + Fields []*StructFieldMeta + Type string + func GetStructMeta(source interface{}) *StructMeta + type Token struct + Matched string + Token int + type Tokenizer struct + EndOfFileToken int + Index int + Input string + InvalidToken int + func NewTokenizer(input string, invalidToken int, endOfFileToken int, matcher map[int]Matcher) *Tokenizer + func (t *Tokenizer) Next(candidate int) *Token + func (t *Tokenizer) Nexts(candidates ...int) *Token + type ToolboxHTTPClient struct + func NewToolboxHTTPClient(options ...*HttpOptions) (*ToolboxHTTPClient, error) + func (c *ToolboxHTTPClient) Request(method, url string, request, response interface{}, ...) (err error) + type UnMarshaler interface + Unmarshal func(data []byte) error + type ValueProvider interface + Get func(context Context, arguments ...interface{}) (interface{}, error) + func NewBetweenPredicateValueProvider() ValueProvider + func NewCastedValueProvider() ValueProvider + func NewCurrentDateProvider() ValueProvider + func NewCurrentTimeProvider() ValueProvider + func NewDateOfBirthrovider() ValueProvider + func NewDictionaryProvider(contextKey interface{}) ValueProvider + func NewEnvValueProvider() ValueProvider + func NewFileValueProvider(trim bool) ValueProvider + func NewNilValueProvider() ValueProvider + func NewTimeDiffProvider() ValueProvider + func NewWeekdayProvider() ValueProvider + func NewWithinSecPredicateValueProvider() ValueProvider + type ValueProviderRegistry interface + Contains func(name string) bool + Get func(name string) ValueProvider + Names func() []string + Register func(name string, valueProvider ValueProvider) + func NewValueProviderRegistry() ValueProviderRegistry + type Zeroable interface + IsZero func() bool