vk_bmstu_schedule_status

package module
v0.0.0-...-1e7ea87 Latest Latest
Warning

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

Go to latest
Published: May 2, 2019 License: AGPL-3.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

vk-bmstu-schedule-status

Display BMSTU week info in VK chat title.

Installation

go get -u github.com/trubitsyn/vk-bmstu-schedule-status/cmd/vk-bmstu-schedule-status

Usage

Usage of vk-bmstu-schedule-status:
  -chat uint
        Chat ID
  -login string
        VK login
  -password string
        VK password
  -prefix string
        Chat title prefix

Testing

go get -t github.com/trubitsyn/vk-bmstu-schedule-status
go test github.com/trubitsyn/vk-bmstu-schedule-status

LICENSE

vk-bmstu-schedule-status
Copyright (C) 2019 Nikola Trubitsyn

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.

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

Documentation

Index

Constants

View Source
const (
	MaxChatId uint = 100000000
)

Variables

This section is empty.

Functions

func CurrentWeek

func CurrentWeek() int

Types

type DefaultVkApiClient

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

func (*DefaultVkApiClient) Connect

func (client *DefaultVkApiClient) Connect(login string, password string) error

func (*DefaultVkApiClient) EditChat

func (client *DefaultVkApiClient) EditChat(chatID uint, title string) error

type Title

type Title struct {
	Prefix   string
	WeekName string
	WeekNum  int
	WeekAbbr string
	// contains filtered or unexported fields
}

func (Title) Format

func (title Title) Format(pattern string) string

type VkApiClient

type VkApiClient interface {
	Connect(token string) error
	EditChat(chatID uint, title string) error
}

type WeekType

type WeekType int
const (
	TypeNumerator WeekType = iota
	TypeDenominator
)

func WeekTypeFromNumber

func WeekTypeFromNumber(weekNumber int) WeekType

func (WeekType) FullWeekName

func (weekType WeekType) FullWeekName() string

func (WeekType) ShortWeekName

func (weekType WeekType) ShortWeekName() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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