eventime

package module
v0.3.4-0...-6d48ce5 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: MIT Imports: 17 Imported by: 1

README

Gitpod Ready-to-Code

Documentation

Index

Constants

View Source
const (
	KindUnix = iota
	KindText
	KindJOSN
	KindRedis
	KindDynamoDB
	KindStorage
)

Variables

View Source
var (
	RequireConfiguration = fmt.Errorf("this ZoneInfo type requires client configuration")
	ErrUnknownZoneInfo   = fmt.Errorf("unknown kind for zone info")
)

Functions

This section is empty.

Types

type ByCity

type ByCity []TimeZone

func (ByCity) Filter

func (zone ByCity) Filter(cities ...string) ByCity

func (ByCity) FindCity

func (zone ByCity) FindCity(city string) (TimeZone, bool)

func (ByCity) Includes

func (zone ByCity) Includes(city string) bool

func (ByCity) Len

func (zone ByCity) Len() int

func (ByCity) Less

func (zone ByCity) Less(a, b int) bool

func (ByCity) Sort

func (zone ByCity) Sort()

func (ByCity) Swap

func (zone ByCity) Swap(a, b int)

type ByGMT

type ByGMT []TimeZone

func Plan

func Plan(event EventInfo, zones ByCity) (ByGMT, error)

func (ByGMT) Format

func (zone ByGMT) Format(w io.Writer) error

func (ByGMT) Len

func (zone ByGMT) Len() int

func (ByGMT) Less

func (zone ByGMT) Less(a, b int) bool

func (ByGMT) Sort

func (zone ByGMT) Sort()

func (ByGMT) String

func (zone ByGMT) String() string

func (ByGMT) Swap

func (zone ByGMT) Swap(a, b int)

type DynamoDB

type DynamoDB struct {
	Client dynamodbiface.DynamoDBAPI

	Table string
	Data  ByCity
}

func (*DynamoDB) Cities

func (z *DynamoDB) Cities() ByCity

func (*DynamoDB) Configure

func (s *DynamoDB) Configure(client interface{}) error

func (*DynamoDB) Copy

func (db *DynamoDB) Copy(other ZoneInfo)

func (*DynamoDB) Load

func (db *DynamoDB) Load(keys ...string) error

func (*DynamoDB) Save

func (db *DynamoDB) Save() error

func (*DynamoDB) Zones

func (z *DynamoDB) Zones() ByGMT

type EventInfo

type EventInfo struct {
	HostCity    string   `json:"host_city"`
	GuestCities []string `json:"guest_cities"`
	EventTime   string   `json:"time"`
	EventDate   string   `json:"date,omitempty"`
}

type JSON

type JSON struct {
	File io.ReadWriteCloser
	Data ByCity
}

func (*JSON) Cities

func (z *JSON) Cities() ByCity

func (*JSON) Configure

func (j *JSON) Configure(interface{}) error

func (*JSON) Copy

func (j *JSON) Copy(other ZoneInfo)

func (*JSON) Load

func (data *JSON) Load(cities ...string) error

func (*JSON) Save

func (j *JSON) Save() error

func (*JSON) Zones

func (z *JSON) Zones() ByGMT

type Redis

type Redis struct {
	Client *redis.Client
	Data   ByCity
}

func (*Redis) Cities

func (z *Redis) Cities() ByCity

func (*Redis) Configure

func (s *Redis) Configure(client interface{}) error

func (*Redis) Copy

func (r *Redis) Copy(other ZoneInfo)

func (*Redis) Load

func (r *Redis) Load(cities ...string) error

func (*Redis) Save

func (r *Redis) Save() error

func (*Redis) Zones

func (z *Redis) Zones() ByGMT

type Storage

type Storage struct {
	*storage.Client
	BucketName, ObjectName string
	Data                   ByCity
}

func (*Storage) Cities

func (z *Storage) Cities() ByCity

func (*Storage) Configure

func (s *Storage) Configure(client interface{}) error

func (*Storage) Copy

func (s *Storage) Copy(other ZoneInfo)

func (*Storage) Load

func (s *Storage) Load(cities ...string) error

func (*Storage) Save

func (s *Storage) Save() error

func (*Storage) Zones

func (z *Storage) Zones() ByGMT

type Text

type Text struct {
	File io.ReadWriteCloser
	Data ByCity
}

func (*Text) Cities

func (z *Text) Cities() ByCity

func (*Text) Configure

func (u *Text) Configure(interface{}) error

func (*Text) Copy

func (t *Text) Copy(other ZoneInfo)

func (*Text) Load

func (t *Text) Load(keys ...string) error

func (*Text) Save

func (t *Text) Save() error

func (*Text) Zones

func (u *Text) Zones() ByGMT

type TimeZone

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

func NewTimeZone

func NewTimeZone(cityName string, locationName string) (TimeZone, error)

func (TimeZone) City

func (tz TimeZone) City() string

func (TimeZone) Clock

func (tz TimeZone) Clock() string

func (TimeZone) GMT

func (tz TimeZone) GMT() string

func (*TimeZone) MarshalJSON

func (tz *TimeZone) MarshalJSON() ([]byte, error)

func (TimeZone) Offset

func (tz TimeZone) Offset() time.Duration

func (TimeZone) ParseClock

func (tz TimeZone) ParseClock(clock string) (TimeZone, error)

func (TimeZone) Set

func (tz TimeZone) Set(t time.Time) TimeZone

func (TimeZone) String

func (tz TimeZone) String() string

func (TimeZone) Time

func (tz TimeZone) Time() time.Time

func (*TimeZone) UnmarshalJSON

func (tz *TimeZone) UnmarshalJSON(b []byte) error

type Unix

type Unix struct {
	Directory string
	SaveTo    string
	Data      ByCity
}

func (*Unix) Cities

func (u *Unix) Cities() ByCity

func (*Unix) Configure

func (u *Unix) Configure(interface{}) error

func (*Unix) Copy

func (u *Unix) Copy(other ZoneInfo)

func (*Unix) Load

func (u *Unix) Load(keys ...string) error

func (*Unix) Save

func (u *Unix) Save() error

func (*Unix) Zones

func (u *Unix) Zones() ByGMT

type ZoneInfo

type ZoneInfo interface {
	Configure(connection interface{}) error
	Load(keys ...string) error
	Save() error
	Copy(other ZoneInfo)
	Zones() ByGMT
	Cities() ByCity
}

func New

func New(location string, kind int) (ZoneInfo, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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