server

package
v0.0.0-...-c193e84 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonInput

type CommonInput struct {
	RequestID uuid.UUID `header:"X-Request-Id" hidden:"true" readOnly:"true"`
}

type Config

type Config struct {
	Logger *slog.Logger

	HTTPTCPBind string
}

type MembersAllInput

type MembersAllInput struct {
	CommonInput
}

type MembersAllOutput

type MembersAllOutput struct {
	Body struct {
		Members []api.Member `json:"members"`
	}
}

type Server

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

func New

func New(c Config, apiClient *api.Client) *Server

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

type TransactionPayingUser

type TransactionPayingUser struct {
	MemberID string  `json:"member_id"`
	Weight   float32 `json:"weight"`
}

type TransactionsAllInput

type TransactionsAllInput struct {
	CommonInput
}

type TransactionsAllOutput

type TransactionsAllOutput struct {
	Body struct {
		Transactions []api.Transaction `json:"transactions"`
	}
}

type TransactionsCreateInput

type TransactionsCreateInput struct {
	CommonInput

	Body struct {
		Purpose   string    `json:"purpose"`
		CreatedAt time.Time `json:"created_at"`

		What struct {
			Amount  float32                 `json:"amount"`
			ForWhom []TransactionPayingUser `json:"for_whom"`
		} `json:"what"`

		WhoPaid []TransactionPayingUser `json:"who_paid"`
	}
}

type TransactionsCreateOutput

type TransactionsCreateOutput struct {
	Body struct {
		ID string `json:"id"`
	}
}

Jump to

Keyboard shortcuts

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