config

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: MIT Imports: 8 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRingCentralSdk

func GetRingCentralSdk(cfg Configuration) (platform.Platform, error)

Types

type AddressBook

type AddressBook struct {
	Contacts    []Contact      `json:"contacts,omitempty"`
	ContactsMap map[string]int `json:"-,omitempty"`
}

func GetAddressBook

func GetAddressBook(filepath string) (AddressBook, error)

func (*AddressBook) GetContactByFirstName

func (ab *AddressBook) GetContactByFirstName(firstName string) (Contact, error)

func (*AddressBook) Inflate

func (ab *AddressBook) Inflate()

type Configuration

type Configuration struct {
	Port                 int
	LogLevel             log.Level
	RcAppKey             string
	RcAppSecret          string
	RcServerURL          string
	RcUsername           string
	RcExtension          string
	RcPassword           string
	RcPhoneNumberRingOut string
	RcPhoneNumberSMS     string
	Platform             platform.Platform
	AddressBook          AddressBook
	Cache                *cache.Cache
}

func NewConfiguration

func NewConfiguration() (Configuration, error)

func (*Configuration) Address

func (c *Configuration) Address() string

Address returns the port address as a string with a `:` prefix

func (*Configuration) LoadEnv

func (c *Configuration) LoadEnv()

type Contact

type Contact struct {
	FirstName   string `json:"firstName,omitempty"`
	LastName    string `json:"lastName,omitempty"`
	PhoneNumber string `json:"phoneNumber,omitempty"`
}

func (*Contact) FullName

func (c *Contact) FullName() string

Jump to

Keyboard shortcuts

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