web

package
v0.0.0-...-05965fc Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Overview

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

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.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

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.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

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.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

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.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

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.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

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

This section is empty.

Variables

This section is empty.

Functions

func AcceptAllOrigins

func AcceptAllOrigins(r *http.Request) bool

func Data

func Data(t string, data interface{}) json.Marshaler

func New

func New(options ...func(*web) error) (*web, error)

func WithConfig

func WithConfig(c toml.Primitive, decoder TomlDecoder) func(*web) error

func WithDataDir

func WithDataDir(dataDir string) func(*web) error

func WithEventBus

func WithEventBus(bus *eventbus.EventBus) func(*web) error

Types

type HotCountry

type HotCountry struct {
	ISOCode string    `json:"isocode"`
	Count   int       `json:"count"`
	Last    time.Time `json:"last"`
}

type Message

type Message struct {
	Type string      `json:"type"`
	Data interface{} `json:"data"`
}

func (Message) MarshalJSON

func (msg Message) MarshalJSON() ([]byte, error)

type Metadata

type Metadata struct {
	Start         time.Time
	Version       string `json:"version"`
	ReleaseTag    string `json:"release_tag"`
	CommitID      string `json:"commitid"`
	ShortCommitID string `json:"shortcommitid"`
}

func (Metadata) MarshalJSON

func (metadata Metadata) MarshalJSON() ([]byte, error)

type SafeArray

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

SafeArray is a thread safe array implementation.

func NewLimitedSafeArray

func NewLimitedSafeArray(limit int) *SafeArray

NewLimitedSafeArray returns a SafeArray with a max limit items.

func NewSafeArray

func NewSafeArray() *SafeArray

NewSafeArray returns a unlimited SafeArray.

func (*SafeArray) Append

func (sa *SafeArray) Append(v interface{})

Append will append an item.

func (*SafeArray) MarshalJSON

func (sa *SafeArray) MarshalJSON() ([]byte, error)

MarshalJSON will marshall the array contents to JSON.

func (*SafeArray) Range

func (sa *SafeArray) Range(fn func(interface{}) bool)

Range will enumerate through all array items.

type TomlDecoder

type TomlDecoder interface {
	PrimitiveDecode(primValue toml.Primitive, v interface{}) error
}

Jump to

Keyboard shortcuts

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