osago

package module
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: GPL-3.0 Imports: 15 Imported by: 0

README

OSAGO

Go-клиент для OpenScheduleApi, сгенерированный на основе OpenAPI-спецификации.

Соответствует версии API v0.3.1

Использование

client := osago.NewClient("http://localhost:3505", 10*time.Second)
schedule, err := client.GetScheduleForToday(ctx, groupID)
if err != nil {
    // handle error
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type AdminClient

type AdminClient struct {
	*Client
	// contains filtered or unexported fields
}

func NewAdminClient

func NewAdminClient(url, token string, timeout time.Duration) *AdminClient

func (*AdminClient) DeleteParser

func (c *AdminClient) DeleteParser(ctx context.Context, id int64) error

func (*AdminClient) NewParser

func (c *AdminClient) NewParser(ctx context.Context, collegeName string, campusNames []string) (string, error)

type AuthTransport

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

func (*AuthTransport) RoundTrip

func (at *AuthTransport) RoundTrip(req *http.Request) (*http.Response, error)

type Client

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

func NewClient

func NewClient(url string, timeout time.Duration) *Client

func (*Client) GetCampus

func (c *Client) GetCampus(ctx context.Context, id int64) (*models.DtoCampusResponse, error)

func (*Client) GetCampusByName

func (c *Client) GetCampusByName(ctx context.Context, collegeID int64, name string) (*models.DtoCampusResponse, error)

func (*Client) GetCampuses

func (c *Client) GetCampuses(ctx context.Context, collegeID int64) ([]*models.DtoCampusResponse, error)

func (*Client) GetCollege

func (c *Client) GetCollege(ctx context.Context, id int64) (*models.DtoCollegeResponse, error)

func (*Client) GetCollegeByName

func (c *Client) GetCollegeByName(ctx context.Context, name string) (*models.DtoCollegeResponse, error)

func (*Client) GetColleges

func (c *Client) GetColleges(ctx context.Context) ([]*models.DtoCollegeResponse, error)

func (*Client) GetGroup

func (c *Client) GetGroup(ctx context.Context, id int64) (*models.DtoStudentGroupResponse, error)

func (*Client) GetGroupByName

func (c *Client) GetGroupByName(ctx context.Context, campusID int64, name string) (*models.DtoStudentGroupResponse, error)

func (*Client) GetGroups

func (c *Client) GetGroups(ctx context.Context, campusID int64) ([]*models.DtoStudentGroupResponse, error)

func (*Client) GetGroupsByCollegeID

func (c *Client) GetGroupsByCollegeID(ctx context.Context, collegeID int64, name *string) ([]*models.DtoStudentGroupResponse, error)

func (*Client) GetScheduleForDate

func (c *Client) GetScheduleForDate(ctx context.Context, groupID int64, date time.Time) (*models.DtoScheduleResponse, error)

func (*Client) GetScheduleForToday

func (c *Client) GetScheduleForToday(ctx context.Context, groupID int64) (*models.DtoScheduleResponse, error)

func (*Client) GetScheduleForTomorrow

func (c *Client) GetScheduleForTomorrow(ctx context.Context, groupID int64) (*models.DtoScheduleResponse, error)

func (*Client) GetScheduleForWeekday

func (c *Client) GetScheduleForWeekday(ctx context.Context, groupID int64, weekday time.Weekday) (*models.DtoScheduleResponse, error)

func (*Client) GetScheduleForWeekdayOfNextWeek

func (c *Client) GetScheduleForWeekdayOfNextWeek(ctx context.Context, groupID int64, weekday time.Weekday) (*models.DtoScheduleResponse, error)

func (*Client) GetScheduleForWeekdayOfPreviousWeek

func (c *Client) GetScheduleForWeekdayOfPreviousWeek(ctx context.Context, groupID int64, weekday time.Weekday) (*models.DtoScheduleResponse, error)

func (*Client) GetSchedulesForCurrentWeek

func (c *Client) GetSchedulesForCurrentWeek(ctx context.Context, groupID int64) ([]*models.DtoScheduleResponse, error)

func (*Client) GetSchedulesForNextWeek

func (c *Client) GetSchedulesForNextWeek(ctx context.Context, groupID int64) ([]*models.DtoScheduleResponse, error)

func (*Client) GetSchedulesForPreviousWeek

func (c *Client) GetSchedulesForPreviousWeek(ctx context.Context, groupID int64) ([]*models.DtoScheduleResponse, error)

type Parser

type Parser interface {
	SendLessons(groups map[string]int64, lessons chan<- []*models.DtoLesson) error
	GetStudentGroupNames(campusName string) (groupNames []string, _ error)
	GetCalls() ([]models.DtoCall, error)
}

type ParserClient

type ParserClient struct {
	*Client
	Parser Parser
	// contains filtered or unexported fields
}

func NewParserClient

func NewParserClient(ctx context.Context, url, token string, timeout time.Duration) (*ParserClient, error)

func (*ParserClient) AddLessons

func (c *ParserClient) AddLessons(ctx context.Context, lessons []*models.DtoLesson) error

func (*ParserClient) GetCampusByName

func (c *ParserClient) GetCampusByName(ctx context.Context, name string) (*models.DtoCampusResponse, error)

func (*ParserClient) GetCampuses

func (c *ParserClient) GetCampuses(ctx context.Context) ([]*models.DtoCampusResponse, error)

func (*ParserClient) GetCollege

func (c *ParserClient) GetCollege(ctx context.Context) (*models.DtoCollegeResponse, error)

func (*ParserClient) GetGroups

func (*ParserClient) GetGroupsByName

func (c *ParserClient) GetGroupsByName(ctx context.Context, name string) ([]*models.DtoStudentGroupResponse, error)

func (*ParserClient) Run

func (c *ParserClient) Run(ctx context.Context, errorCh chan<- error) error

func (*ParserClient) SetParser

func (c *ParserClient) SetParser(parser Parser)

func (*ParserClient) UpdateCalls

func (c *ParserClient) UpdateCalls(ctx context.Context, calls []models.DtoCall) error

func (*ParserClient) UpdateGroups

func (c *ParserClient) UpdateGroups(ctx context.Context, campusID int64, studentGroupNames []string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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