Compare commits
No commits in common. "2e4f4281de4d2a67629f735f7dbd2a6e9bb2f006" and "e5092d38986177b566f418e08a885b62e79d40ef" have entirely different histories.
2e4f4281de
...
e5092d3898
@ -19,8 +19,6 @@ func NewRoutes(w io.Writer, pkgName string) *RoutesGenerator {
|
|||||||
|
|
||||||
func (r *RoutesGenerator) Generate(routes []parser.Route, impls map[string]string) error {
|
func (r *RoutesGenerator) Generate(routes []parser.Route, impls map[string]string) error {
|
||||||
f := jen.NewFile(r.PkgName)
|
f := jen.NewFile(r.PkgName)
|
||||||
f.HeaderComment("Code generated by go.arsenm.dev/go-lemmy/cmd/gen (routes generator). DO NOT EDIT.")
|
|
||||||
|
|
||||||
for _, r := range routes {
|
for _, r := range routes {
|
||||||
resStruct := impls[r.Struct]
|
resStruct := impls[r.Struct]
|
||||||
|
|
||||||
|
@ -19,8 +19,6 @@ func NewStruct(w io.Writer, pkgName string) *StructGenerator {
|
|||||||
|
|
||||||
func (s *StructGenerator) Generate(items []parser.Item) error {
|
func (s *StructGenerator) Generate(items []parser.Item) error {
|
||||||
f := jen.NewFile(s.PkgName)
|
f := jen.NewFile(s.PkgName)
|
||||||
f.HeaderComment("Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.")
|
|
||||||
|
|
||||||
for _, item := range items {
|
for _, item := range items {
|
||||||
if item.Struct != nil {
|
if item.Struct != nil {
|
||||||
st := item.Struct
|
st := item.Struct
|
||||||
|
@ -242,10 +242,6 @@ func TransformNameGo(s string) string {
|
|||||||
out += "URL"
|
out += "URL"
|
||||||
case "nsfw":
|
case "nsfw":
|
||||||
out += "NSFW"
|
out += "NSFW"
|
||||||
case "jwt":
|
|
||||||
out += "JWT"
|
|
||||||
case "crud":
|
|
||||||
out += "CRUD"
|
|
||||||
default:
|
default:
|
||||||
if len(segment) == 0 {
|
if len(segment) == 0 {
|
||||||
continue
|
continue
|
||||||
|
2
lemmy.go
2
lemmy.go
@ -45,7 +45,7 @@ func (c *Client) ClientLogin(ctx context.Context, l types.Login) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
c.Token = lr.JWT.MustValue()
|
c.Token = lr.Jwt.MustValue()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (routes generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package lemmy
|
package lemmy
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type Activity struct {
|
type Activity struct {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type Comment struct {
|
type Comment struct {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type CreateComment struct {
|
type CreateComment struct {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type CommentReport struct {
|
type CommentReport struct {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type Community struct {
|
type Community struct {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type GetCommunity struct {
|
type GetCommunity struct {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type CommunityBlock struct {
|
type CommunityBlock struct {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type EmailVerification struct {
|
type EmailVerification struct {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type SortType string
|
type SortType string
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type UserOperation string
|
type UserOperation string
|
||||||
|
@ -1,3 +1 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type LocalUser struct {
|
type LocalUser struct {
|
||||||
|
@ -1,3 +1 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type ModRemovePost struct {
|
type ModRemovePost struct {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type PasswordResetRequest struct {
|
type PasswordResetRequest struct {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type Person struct {
|
type Person struct {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type Login struct {
|
type Login struct {
|
||||||
@ -56,7 +54,7 @@ type ChangePassword struct {
|
|||||||
Auth string `json:"auth" url:"auth,omitempty"`
|
Auth string `json:"auth" url:"auth,omitempty"`
|
||||||
}
|
}
|
||||||
type LoginResponse struct {
|
type LoginResponse struct {
|
||||||
JWT Optional[string] `json:"jwt" url:"jwt,omitempty"`
|
Jwt Optional[string] `json:"jwt" url:"jwt,omitempty"`
|
||||||
RegistrationCreated bool `json:"registration_created" url:"registration_created,omitempty"`
|
RegistrationCreated bool `json:"registration_created" url:"registration_created,omitempty"`
|
||||||
VerifyEmailSent bool `json:"verify_email_sent" url:"verify_email_sent,omitempty"`
|
VerifyEmailSent bool `json:"verify_email_sent" url:"verify_email_sent,omitempty"`
|
||||||
LemmyResponse
|
LemmyResponse
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type PersonBlock struct {
|
type PersonBlock struct {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type PersonMention struct {
|
type PersonMention struct {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type Post struct {
|
type Post struct {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type CreatePost struct {
|
type CreatePost struct {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type PostReport struct {
|
type PostReport struct {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type PrivateMessage struct {
|
type PrivateMessage struct {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type RegistrationApplication struct {
|
type RegistrationApplication struct {
|
||||||
|
@ -1,3 +1 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type Secret struct {
|
type Secret struct {
|
||||||
ID int32 `json:"id" url:"id,omitempty"`
|
ID int32 `json:"id" url:"id,omitempty"`
|
||||||
JWTSecret string `json:"jwt_secret" url:"jwt_secret,omitempty"`
|
JwtSecret string `json:"jwt_secret" url:"jwt_secret,omitempty"`
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type Site struct {
|
type Site struct {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type Search struct {
|
type Search struct {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type CommentReportView struct {
|
type CommentReportView struct {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type ModAddCommunityView struct {
|
type ModAddCommunityView struct {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type CommentAggregates struct {
|
type CommentAggregates struct {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type CommunityBlockView struct {
|
type CommunityBlockView struct {
|
||||||
|
@ -1,3 +1 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
|
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type UserJoin struct {
|
type UserJoin struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user