Documentation ¶
Index ¶
- type AmountClient
- type ReportClient
- type Session
- func (s *Session) CloseConn() error
- func (s *Session) CreateAmount(a api.Amount) error
- func (s *Session) CreateTicket(t api.Ticket) error
- func (s *Session) CreateTime(t api.Time) error
- func (s *Session) DeleteAmount(api.Amount) error
- func (s *Session) DeleteTicket(api.Ticket) error
- func (s *Session) DeleteTime(t api.Time) error
- func (s *Session) GetAmounts(api.AmountQuery) ([]api.Amount, error)
- func (s *Session) GetTickets() ([]api.Ticket, error)
- func (s *Session) GetTimes(q api.TimeQuery) ([]api.Time, error)
- func (s *Session) GetTokenFile() string
- func (s *Session) Login(l *api.Login) (*api.Session, error)
- func (s *Session) SetToken(ctx context.Context) (context.Context, error)
- func (s *Session) Signup(u *api.User) (*api.User, error)
- func (s *Session) StreamInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, ...) (grpc.ClientStream, error)
- func (s *Session) TicketTotals(q api.TotalsQuery) ([]api.TotalReport, error)
- func (s *Session) UnaryInterceptor(ctx context.Context, method string, req interface{}, reply interface{}, ...) error
- func (s *Session) UpdateAmount(api.Amount) error
- func (s *Session) UpdateTicket(api.Ticket) error
- func (s *Session) UpdateTime(t api.Time) error
- type SessionClient
- type TicketClient
- type TimeClient
- type UserClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AmountClient ¶
type AmountClient interface { GetAmounts(api.AmountQuery) ([]api.Amount, error) CreateAmount(api.Amount) error UpdateAmount(api.Amount) error DeleteAmount(api.Amount) error }
AmountClient is the interface to the amounts API
type ReportClient ¶
type ReportClient interface {
TicketTotals(api.TotalsQuery) ([]api.TotalReport, error)
}
ReportClient is the interface to the reports API
type Session ¶
type Session struct { Conn *grpc.ClientConn TokenFile string }
Session represents a session with the API endpoint
func NewSession ¶
NewSession opens a connection to the API and returns a populated session
func (*Session) CreateAmount ¶
CreateAmount calls the API to create an amount
func (*Session) CreateTicket ¶
CreateTicket calls the API to create an amount
func (*Session) CreateTime ¶
CreateTime calls the API to create a time
func (*Session) DeleteAmount ¶
DeleteAmount calls the API to delete an amount
func (*Session) DeleteTicket ¶
DeleteTicket calls the API to delete an amount
func (*Session) DeleteTime ¶
DeleteTime calls the API to delete a time
func (*Session) GetAmounts ¶
GetAmounts calls the API to get amounts according to query params
func (*Session) GetTickets ¶
GetTickets calls the API to get tickets for the current user
func (*Session) GetTokenFile ¶
GetTokenFile returns the token filename
func (*Session) StreamInterceptor ¶
func (s *Session) StreamInterceptor( ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption, ) (grpc.ClientStream, error)
StreamInterceptor adds the authentication token to the streaming request
func (*Session) TicketTotals ¶
func (s *Session) TicketTotals(q api.TotalsQuery) ([]api.TotalReport, error)
TicketTotals calls the API and returns a slice of tickets
func (*Session) UnaryInterceptor ¶
func (s *Session) UnaryInterceptor( ctx context.Context, method string, req interface{}, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption, ) error
UnaryInterceptor adds the authentication token to the unary request
func (*Session) UpdateAmount ¶
UpdateAmount calls the API to update an amount
func (*Session) UpdateTicket ¶
UpdateTicket calls the API to update an amount
type SessionClient ¶
SessionClient is the interface to the session api
type TicketClient ¶
type TicketClient interface { GetTickets() ([]api.Ticket, error) CreateTicket(api.Ticket) error UpdateTicket(api.Ticket) error DeleteTicket(api.Ticket) error }
TicketClient is the interface to the tickets api