swanop

package module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: Apache-2.0 Imports: 15 Imported by: 1

README

swan-op-go

Secure Web Addressability Network (SWAN) Operators - an open source secure and privacy supporting cross domain identity network implemented in Go

Documentation

Index

Constants

View Source
const ValidationTimeFormat = "2006-01-02T15:04:05Z07:00"

The time format to use when adding the validation time to the response.

Variables

This section is empty.

Functions

func AddHandlers

func AddHandlers(
	settingsFile string,
	swanAccess access.Access,
	malformedHandler func(w http.ResponseWriter, r *http.Request)) error

AddHandlers adds swift and owid end points configured from the JSON file provided. settingsFile path to the file that contains the configuration settings. swanAccess an authorization instance used to valid requests. malformedHandler if SWAN can't handle the request the handler to use instead.

Types

type Configuration

type Configuration struct {
	Scheme string `json:"scheme"` // The scheme to use for requests
	Debug  bool   `json:"debug"`
	// Seconds until the value provided should be revalidated
	RevalidateSeconds int `json:"revalidateSeconds"`
	// The number of days after which the data will automatically be removed
	// from SWAN and will need to be provided again by the user.
	DeleteDays int `json:"deleteDays"`
}

Configuration maps to the appsettings.json settings file.

func (*Configuration) DeleteDate

func (c *Configuration) DeleteDate() time.Time

Gets the delete date for the SWAN data. This is the data after which the date will be removed from the network. Users will have to re-enter the data after this time.

func (*Configuration) RevalidateSecondsDuration

func (c *Configuration) RevalidateSecondsDuration() time.Duration

RevalidateSecondsDuration in seconds as a time.Duration

Jump to

Keyboard shortcuts

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