utils

package
v0.9.1-rc3 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2014 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Rating system designed to be used in VoIP Carriers World Copyright (C) 2013 ITsysCOM

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>

Index

Constants

View Source
const (
	VERSION                  = "0.9.1c3"
	POSTGRES                 = "postgres"
	MYSQL                    = "mysql"
	MONGO                    = "mongo"
	REDIS                    = "redis"
	LOCALHOST                = "127.0.0.1"
	FSCDR_FILE_CSV           = "freeswitch_file_csv"
	FSCDR_HTTP_JSON          = "freeswitch_http_json"
	NOT_IMPLEMENTED          = "not implemented"
	PREPAID                  = "prepaid"
	POSTPAID                 = "postpaid"
	PSEUDOPREPAID            = "pseudoprepaid"
	RATED                    = "rated"
	ERR_NOT_IMPLEMENTED      = "NOT_IMPLEMENTED"
	ERR_SERVER_ERROR         = "SERVER_ERROR"
	ERR_NOT_FOUND            = "NOT_FOUND"
	ERR_MANDATORY_IE_MISSING = "MANDATORY_IE_MISSING"
	ERR_EXISTS               = "EXISTS"
	ERR_BROKEN_REFERENCE     = "BROKEN_REFERENCE"
	TBL_TP_TIMINGS           = "tp_timings"
	TBL_TP_DESTINATIONS      = "tp_destinations"
	TBL_TP_RATES             = "tp_rates"
	TBL_TP_DESTINATION_RATES = "tp_destination_rates"
	TBL_TP_RATING_PLANS      = "tp_rating_plans"
	TBL_TP_RATE_PROFILES     = "tp_rating_profiles"
	TBL_TP_ACTIONS           = "tp_actions"
	TBL_TP_ACTION_TIMINGS    = "tp_action_timings"
	TBL_TP_ACTION_TRIGGERS   = "tp_action_triggers"
	TBL_TP_ACCOUNT_ACTIONS   = "tp_account_actions"
	TBL_CDRS_PRIMARY         = "cdrs_primary"
	TBL_CDRS_EXTRA           = "cdrs_extra"
	TBL_COST_DETAILS         = "cost_details"
	TBL_RATED_CDRS           = "rated_cdrs"
	TIMINGS_CSV              = "Timings.csv"
	DESTINATIONS_CSV         = "Destinations.csv"
	RATES_CSV                = "Rates.csv"
	DESTINATION_RATES_CSV    = "DestinationRates.csv"
	RATING_PLANS_CSV         = "RatingPlans.csv"
	RATING_PROFILES_CSV      = "RatingProfiles.csv"
	ACTIONS_CSV              = "Actions.csv"
	ACTION_TIMINGS_CSV       = "ActionTimings.csv"
	ACTION_TRIGGERS_CSV      = "ActionTriggers.csv"
	ACCOUNT_ACTIONS_CSV      = "AccountActions.csv"
	TIMINGS_NRCOLS           = 6
	DESTINATIONS_NRCOLS      = 2
	RATES_NRCOLS             = 8
	DESTINATION_RATES_NRCOLS = 3
	DESTRATE_TIMINGS_NRCOLS  = 4
	RATE_PROFILES_NRCOLS     = 7
	ACTIONS_NRCOLS           = 11
	ACTION_TIMINGS_NRCOLS    = 4
	ACTION_TRIGGERS_NRCOLS   = 8
	ACCOUNT_ACTIONS_NRCOLS   = 5
	ROUNDING_UP              = "*up"
	ROUNDING_MIDDLE          = "*middle"
	ROUNDING_DOWN            = "*down"
	ANY                      = "*any"
	COMMENT_CHAR             = '#'
	CSV_SEP                  = ','
	FALLBACK_SEP             = ';'
	JSON                     = "json"
	MSGPACK                  = "msgpack"
	CSV_LOAD                 = "CSVLOAD"
	ACCID                    = "accid"
	CDRHOST                  = "cdrhost"
	CDRSOURCE                = "cdrsource"
	REQTYPE                  = "reqtype"
	DIRECTION                = "direction"
	TENANT                   = "tenant"
	TOR                      = "tor"
	ACCOUNT                  = "account"
	SUBJECT                  = "subject"
	DESTINATION              = "destination"
	ANSWER_TIME              = "answer_time"
	DURATION                 = "duration"
	DEFAULT_RUNID            = "default"
	STATIC_VALUE_PREFIX      = "^"
	CDRE_CSV                 = "csv"
	CDRE_DRYRUN              = "dry_run"
)

Variables

View Source
var (
	CdreCdrFormats = []string{CDRE_CSV, CDRE_DRYRUN}
)

Functions

func BalanceKey

func BalanceKey(tenant, account, direction string) string

func ConvertMapValStrIf

func ConvertMapValStrIf(inMap map[string]string) map[string]interface{}

Converts map[string]string into map[string]interface{}

func CopyHour

func CopyHour(src, dest time.Time) time.Time

func FSCgrId

func FSCgrId(uuid string) string

func FallbackSubjKeys

func FallbackSubjKeys(direction, tenant, tor, fallbackSubjects string) []string

Helper to return the subject fallback keys we need in dataDb

func FirstNonEmpty

func FirstNonEmpty(vals ...string) string

Returns first non empty string out of vals. Useful to extract defaults

func GenUUID

func GenUUID() string

helper function for uuid generation

func IsSliceMember

func IsSliceMember(ss []string, s string) bool

Binary string search in slice

func MapKeys

func MapKeys(m map[string]string) []string

Return map keys

func MirrorMap

func MirrorMap(mapIn map[string]string) (map[string]string, error)

Mirrors key/val

func MissingMapKeys

func MissingMapKeys(inMap map[string]string, requiredKeys []string) []string

Returns mising keys in a map

func MissingStructFields

func MissingStructFields(s interface{}, mandatories []string) []string

Detects missing field values based on mandatory field names, s should be a pointer to a struct

func NewTPid

func NewTPid() string

func NonemptyStructFields

func NonemptyStructFields(s interface{}) map[string]interface{}

Detects nonempty struct fields, s should be a pointer to a struct Useful to not overwrite db fields with non defined params in api

func ParseDate

func ParseDate(date string) (expDate time.Time, err error)

func ParseDurationWithSecs

func ParseDurationWithSecs(durStr string) (time.Duration, error)

Parses duration, considers s as time unit if not provided

func ParseTimeDetectLayout

func ParseTimeDetectLayout(tmStr string) (time.Time, error)

func Round

func Round(x float64, prec int, method string) float64

Round return rounded version of x with prec precision.

Special cases are:

Round(±0) = ±0
Round(±Inf) = ±Inf
Round(NaN) = NaN

func RoundTo

func RoundTo(whole, amount time.Duration) time.Duration

returns a number equeal or larger than the amount that exactly is divisible to whole

func SHA1

func SHA1(text string) string

func SliceMemberHasPrefix

func SliceMemberHasPrefix(ss []string, prfx string) bool

Iterates over slice members and returns true of one starts with prefix

func SplitPrefix

func SplitPrefix(prefix string) []string

func StrucToMap

func StrucToMap(s interface{}) map[string]interface{}

Converts a struct to map

func UpdateStructWithStrMap

func UpdateStructWithStrMap(s interface{}, m map[string]string) []string

Update struct with map fields, returns not matching map keys, s is a struct to be updated

Types

type ApiReloadCache

type ApiReloadCache struct {
	DestinationIds   []string
	RatingPlanIds    []string
	RatingProfileIds []string
	ActionIds        []string
}

Data used to do remote cache reloads via api

type ApierTPTiming

type ApierTPTiming struct {
	TPid      string // Tariff plan id
	TimingId  string // Timing id
	Years     string // semicolon separated list of years this timing is valid on, *any supported
	Months    string // semicolon separated list of months this timing is valid on, *any supported
	MonthDays string // semicolon separated list of month's days this timing is valid on, *any supported
	WeekDays  string // semicolon separated list of week day names this timing is valid on *any supported
	Time      string // String representing the time this timing starts on
}

type AttrCacheStats

type AttrCacheStats struct {
}

type AttrCachedItemAge

type AttrCachedItemAge struct {
	Category string // Item's category, same name as .csv files without extension
	ItemId   string // Item's identity tag
}

type AttrExpFileCdrs

type AttrExpFileCdrs struct {
	CdrFormat    string // Cdr output file format <utils.CdreCdrFormats>
	TimeStart    string // If provided, will represent the starting of the CDRs interval (>=)
	TimeEnd      string // If provided, will represent the end of the CDRs interval (<)
	RemoveFromDb bool   // If true the CDRs will be also deleted after export

}

type AttrTPRatingProfileIds

type AttrTPRatingProfileIds struct {
	TPid      string // Tariff plan id
	Tenant    string // Tenant's Id
	TOR       string // TypeOfRecord
	Direction string // Traffic direction
	Subject   string // Rating subject, usually the same as account
}

type CacheStats

type CacheStats struct {
	Destinations   int
	RatingPlans    int
	RatingProfiles int
	Actions        int
}

type CachedItemAge

type CachedItemAge struct {
	Destination   time.Duration
	RatingPlan    time.Duration
	RatingProfile time.Duration
	Action        time.Duration
}

type CgrCdr

type CgrCdr map[string]string

func NewCgrCdrFromHttpReq

func NewCgrCdrFromHttpReq(req *http.Request) (CgrCdr, error)

func (CgrCdr) AsRatedCdr

func (cgrCdr CgrCdr) AsRatedCdr(runId, reqTypeFld, directionFld, tenantFld, torFld, accountFld, subjectFld, destFld, answerTimeFld, durationFld string, extraFlds []string, fieldsMandatory bool) (*RatedCDR, error)

Used in mediation, fieldsMandatory marks whether missing field out of request represents error or can be ignored If the fields in parameters start with ^ their value is considered instead of dynamically retrieving it from CDR

func (CgrCdr) GetAccId

func (cgrCdr CgrCdr) GetAccId() string

func (CgrCdr) GetAccount

func (cgrCdr CgrCdr) GetAccount() string

func (CgrCdr) GetAnswerTime

func (cgrCdr CgrCdr) GetAnswerTime() (t time.Time, err error)

func (CgrCdr) GetCdrHost

func (cgrCdr CgrCdr) GetCdrHost() string

func (CgrCdr) GetCdrSource

func (cgrCdr CgrCdr) GetCdrSource() string

func (CgrCdr) GetCgrId

func (cgrCdr CgrCdr) GetCgrId() string

func (CgrCdr) GetDestination

func (cgrCdr CgrCdr) GetDestination() string

Charging destination number

func (CgrCdr) GetDirection

func (cgrCdr CgrCdr) GetDirection() string

func (CgrCdr) GetDuration

func (cgrCdr CgrCdr) GetDuration() time.Duration

Extracts duration as considered by the telecom switch

func (CgrCdr) GetExtraFields

func (cgrCdr CgrCdr) GetExtraFields() map[string]string

func (CgrCdr) GetOrigId

func (cgrCdr CgrCdr) GetOrigId() string

func (CgrCdr) GetReqType

func (cgrCdr CgrCdr) GetReqType() string

func (CgrCdr) GetSubject

func (cgrCdr CgrCdr) GetSubject() string

func (CgrCdr) GetTOR

func (cgrCdr CgrCdr) GetTOR() string

func (CgrCdr) GetTenant

func (cgrCdr CgrCdr) GetTenant() string

type DestinationRate

type DestinationRate struct {
	DestinationId string // The destination identity
	RateId        string // The rate identity
	Rate          *TPRate
}

type ExportedFileCdrs

type ExportedFileCdrs struct {
	ExportedFilePath string // Full path to the newly generated export file
	NumberOfRecords  int    // Number of CDRs in the export file
}

type LoggerInterface

type LoggerInterface interface {
	Alert(m string) error
	Close() error
	Crit(m string) error
	Debug(m string) error
	Emerg(m string) error
	Err(m string) error
	Info(m string) error
	Notice(m string) error
	Warning(m string) error
}

type MonthDays

type MonthDays []int

Defines month days series

func (MonthDays) Contains

func (md MonthDays) Contains(monthDay int) (result bool)

Return true if the specified date is inside the series

func (MonthDays) Len

func (md MonthDays) Len() int

func (MonthDays) Less

func (md MonthDays) Less(j, i int) bool

func (*MonthDays) Parse

func (md *MonthDays) Parse(input, sep string)

Parse MonthDay elements from string separated by sep.

func (MonthDays) Serialize

func (md MonthDays) Serialize(sep string) string

Dumps the month days in a serialized string, similar to the one parsed

func (MonthDays) Sort

func (md MonthDays) Sort()

func (MonthDays) Swap

func (md MonthDays) Swap(i, j int)

type Months

type Months []time.Month

Defines months series

func (Months) Contains

func (m Months) Contains(month time.Month) (result bool)

Return true if the specified date is inside the series

func (Months) Len

func (m Months) Len() int

func (Months) Less

func (m Months) Less(j, i int) bool

func (*Months) Parse

func (m *Months) Parse(input, sep string)

Loades Month elemnents from a string separated by sep.

func (Months) Serialize

func (m Months) Serialize(sep string) string

Dumps the months in a serialized string, similar to the one parsed

func (Months) Sort

func (m Months) Sort()

func (Months) Swap

func (m Months) Swap(i, j int)

type RateSlot

type RateSlot struct {
	ConnectFee         float64 // ConnectFee applied once the call is answered
	Rate               float64 // Rate applied
	RateUnit           string  //  Number of billing units this rate applies to
	RateIncrement      string  // This rate will apply in increments of duration
	GroupIntervalStart string  // Group position
	RoundingMethod     string  // Use this method to round the cost
	RoundingDecimals   int     // Round the cost number of decimals
	// contains filtered or unexported fields
}

func NewRateSlot

func NewRateSlot(connectFee, rate float64, rateUnit, rateIncrement, grpInterval, rndMethod string, rndDecimals int) (*RateSlot, error)

Needed so we make sure we always use SetDurations() on a newly created value

func (*RateSlot) GroupIntervalStartDuration

func (self *RateSlot) GroupIntervalStartDuration() time.Duration

func (*RateSlot) RateIncrementDuration

func (self *RateSlot) RateIncrementDuration() time.Duration

func (*RateSlot) RateUnitDuration

func (self *RateSlot) RateUnitDuration() time.Duration

func (*RateSlot) SetDurations

func (self *RateSlot) SetDurations() error

Used to set the durations we need out of strings

type RatedCDR

type RatedCDR struct {
	CgrId          string
	AccId          string
	CdrHost        string
	CdrSource      string
	ReqType        string
	Direction      string
	Tenant         string
	TOR            string
	Account        string
	Subject        string
	Destination    string
	AnswerTime     time.Time
	Duration       time.Duration
	ExtraFields    map[string]string
	MediationRunId string
	Cost           float64
}

Rated CDR as extracted from StorDb. Kinda standard of internal CDR, complies to CDR interface also

func NewRatedCDRFromRawCDR

func NewRatedCDRFromRawCDR(rawcdr RawCDR) (*RatedCDR, error)

func (*RatedCDR) AsRatedCdr

func (ratedCdr *RatedCDR) AsRatedCdr(runId, reqTypeFld, directionFld, tenantFld, torFld, accountFld, subjectFld, destFld, answerTimeFld, durationFld string, extraFlds []string, fieldsMandatory bool) (*RatedCDR, error)

func (*RatedCDR) GetAccId

func (ratedCdr *RatedCDR) GetAccId() string

func (*RatedCDR) GetAccount

func (ratedCdr *RatedCDR) GetAccount() string

func (*RatedCDR) GetAnswerTime

func (ratedCdr *RatedCDR) GetAnswerTime() (time.Time, error)

func (*RatedCDR) GetCdrHost

func (ratedCdr *RatedCDR) GetCdrHost() string

func (*RatedCDR) GetCdrSource

func (ratedCdr *RatedCDR) GetCdrSource() string

func (*RatedCDR) GetCgrId

func (ratedCdr *RatedCDR) GetCgrId() string

func (*RatedCDR) GetDestination

func (ratedCdr *RatedCDR) GetDestination() string

func (*RatedCDR) GetDirection

func (ratedCdr *RatedCDR) GetDirection() string

func (*RatedCDR) GetDuration

func (ratedCdr *RatedCDR) GetDuration() time.Duration

func (*RatedCDR) GetExtraFields

func (ratedCdr *RatedCDR) GetExtraFields() map[string]string

func (*RatedCDR) GetReqType

func (ratedCdr *RatedCDR) GetReqType() string

func (*RatedCDR) GetSubject

func (ratedCdr *RatedCDR) GetSubject() string

func (*RatedCDR) GetTOR

func (ratedCdr *RatedCDR) GetTOR() string

func (*RatedCDR) GetTenant

func (ratedCdr *RatedCDR) GetTenant() string

type RawCDR

type RawCDR interface {
	GetCgrId() string
	GetAccId() string
	GetCdrHost() string
	GetCdrSource() string
	GetDirection() string
	GetSubject() string
	GetAccount() string
	GetDestination() string
	GetTOR() string
	GetTenant() string
	GetReqType() string
	GetAnswerTime() (time.Time, error)
	GetDuration() time.Duration
	GetExtraFields() map[string]string                                                                                            //Stores extra CDR Fields
	AsRatedCdr(string, string, string, string, string, string, string, string, string, string, []string, bool) (*RatedCDR, error) // Based on fields queried will return a particular instance of RatedCDR
}

RawCDR is the type containing all the original CDR fields, needs it as it is for later usage

type StdLogger

type StdLogger struct{}

Logs to standard output

func (*StdLogger) Alert

func (sl *StdLogger) Alert(m string) (err error)

func (*StdLogger) Close

func (sl *StdLogger) Close() (err error)

func (*StdLogger) Crit

func (sl *StdLogger) Crit(m string) (err error)

func (*StdLogger) Debug

func (sl *StdLogger) Debug(m string) (err error)

func (*StdLogger) Emerg

func (sl *StdLogger) Emerg(m string) (err error)

func (*StdLogger) Err

func (sl *StdLogger) Err(m string) (err error)

func (*StdLogger) Info

func (sl *StdLogger) Info(m string) (err error)

func (*StdLogger) Notice

func (sl *StdLogger) Notice(m string) (err error)

func (*StdLogger) Warning

func (sl *StdLogger) Warning(m string) (err error)

type TPAccountActions

type TPAccountActions struct {
	TPid             string // Tariff plan id
	LoadId           string // LoadId, used to group actions on a load
	Tenant           string // Tenant's Id
	Account          string // Account name
	Direction        string // Traffic direction
	ActionTimingsId  string // Id of ActionTimings profile to use
	ActionTriggersId string // Id of ActionTriggers profile to use
}

func NewTPAccountActionsFromKeyId

func NewTPAccountActionsFromKeyId(tpid, loadId, keyId string) (*TPAccountActions, error)

Used to rebuild a TPAccountActions (empty ActionTimingsId and ActionTriggersId) out of it's key in nosqldb

func (*TPAccountActions) KeyId

func (self *TPAccountActions) KeyId() string

Returns the id used in some nosql dbs (eg: redis)

type TPAction

type TPAction struct {
	Identifier      string  // Identifier mapped in the code
	BalanceType     string  // Type of balance the action will operate on
	Direction       string  // Balance direction
	Units           float64 // Number of units to add/deduct
	ExpiryTime      string  // Time when the units will expire
	DestinationId   string  // Destination profile id
	RatingSubject   string  // Reference a rate subject defined in RatingProfiles
	BalanceWeight   float64 // Balance weight
	ExtraParameters string
	Weight          float64 // Action's weight
}

type TPActionTiming

type TPActionTiming struct {
	ActionsId string  // Actions id
	TimingId  string  // Timing profile id
	Weight    float64 // Binding's weight
}

type TPActionTimings

type TPActionTimings struct {
	TPid            string            // Tariff plan id
	ActionTimingsId string            // ActionTimings id
	ActionTimings   []*TPActionTiming // Set of ActionTiming bindings this profile will group
}

type TPActionTrigger

type TPActionTrigger struct {
	BalanceType    string  // Type of balance this trigger monitors
	Direction      string  // Traffic direction
	ThresholdType  string  // This threshold type
	ThresholdValue float64 // Threshold
	DestinationId  string  // Id of the destination profile
	ActionsId      string  // Actions which will execute on threshold reached
	Weight         float64 // weight
}

type TPActionTriggers

type TPActionTriggers struct {
	TPid             string             // Tariff plan id
	ActionTriggersId string             // Profile id
	ActionTriggers   []*TPActionTrigger // Set of triggers grouped in this profile

}

type TPActions

type TPActions struct {
	TPid      string      // Tariff plan id
	ActionsId string      // Actions id
	Actions   []*TPAction // Set of actions this Actions profile will perform
}

type TPDestination

type TPDestination struct {
	TPid          string   // Tariff plan id
	DestinationId string   // Destination id
	Prefixes      []string // Prefixes attached to this destination
}

type TPDestinationRate

type TPDestinationRate struct {
	TPid              string             // Tariff plan id
	DestinationRateId string             // DestinationRate profile id
	DestinationRates  []*DestinationRate // Set of destinationid-rateid bindings
}

type TPRate

type TPRate struct {
	TPid      string      // Tariff plan id
	RateId    string      // Rate id
	RateSlots []*RateSlot // One or more RateSlots
}

type TPRatingActivation

type TPRatingActivation struct {
	ActivationTime   string // Time when this profile will become active, defined as unix epoch time
	RatingPlanId     string // Id of RatingPlan profile
	FallbackSubjects string // So we follow the api
}

type TPRatingPlan

type TPRatingPlan struct {
	TPid               string                 // Tariff plan id
	RatingPlanId       string                 // RatingPlan profile id
	RatingPlanBindings []*TPRatingPlanBinding // Set of destinationid-rateid bindings
}

type TPRatingPlanBinding

type TPRatingPlanBinding struct {
	DestinationRatesId string  // The DestinationRate identity
	TimingId           string  // The timing identity
	Weight             float64 // Binding priority taken into consideration when more DestinationRates are active on a time slot
	// contains filtered or unexported fields
}

func (*TPRatingPlanBinding) SetTiming

func (self *TPRatingPlanBinding) SetTiming(tm *TPTiming)

func (*TPRatingPlanBinding) Timing

func (self *TPRatingPlanBinding) Timing() *TPTiming

type TPRatingProfile

type TPRatingProfile struct {
	TPid                  string                // Tariff plan id
	LoadId                string                // Gives ability to load specific RatingProfile based on load identifier, hence being able to keep history also in stordb
	Tenant                string                // Tenant's Id
	TOR                   string                // TypeOfRecord
	Direction             string                // Traffic direction, OUT is the only one supported for now
	Subject               string                // Rating subject, usually the same as account
	RatingPlanActivations []*TPRatingActivation // Activate rate profiles at specific time
}

func NewTPRatingProfileFromKeyId

func NewTPRatingProfileFromKeyId(tpid, loadId, keyId string) (*TPRatingProfile, error)

Used to rebuild a TPRatingProfile (empty RatingPlanActivations) out of it's key in nosqldb

func (*TPRatingProfile) KeyId

func (self *TPRatingProfile) KeyId() string

Used as key in nosql db (eg: redis)

type TPTiming

type TPTiming struct {
	Id        string
	Years     Years
	Months    Months
	MonthDays MonthDays
	WeekDays  WeekDays
	StartTime string
}

type WeekDays

type WeekDays []time.Weekday

Defines week days series

func (WeekDays) Contains

func (wd WeekDays) Contains(weekDay time.Weekday) (result bool)

Return true if the specified date is inside the series

func (WeekDays) Len

func (wd WeekDays) Len() int

func (WeekDays) Less

func (wd WeekDays) Less(j, i int) bool

func (*WeekDays) Parse

func (wd *WeekDays) Parse(input, sep string)

func (WeekDays) Serialize

func (wd WeekDays) Serialize(sep string) string

Dumps the week days in a serialized string, similar to the one parsed

func (WeekDays) Sort

func (wd WeekDays) Sort()

func (WeekDays) Swap

func (wd WeekDays) Swap(i, j int)

type Years

type Years []int

Defines years days series

func (Years) Contains

func (ys Years) Contains(year int) (result bool)

Return true if the specified date is inside the series

func (Years) Len

func (ys Years) Len() int

func (Years) Less

func (ys Years) Less(j, i int) bool

func (*Years) Parse

func (ys *Years) Parse(input, sep string)

Parse Years elements from string separated by sep.

func (Years) Serialize

func (ys Years) Serialize(sep string) string

func (Years) Sort

func (ys Years) Sort()

func (Years) Swap

func (ys Years) Swap(i, j int)

Jump to

Keyboard shortcuts

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