api

package
v0.0.0-...-d3c8959 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package api provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHandlers

func RegisterHandlers(router EchoRouter, si ServerInterface)

RegisterHandlers adds each server route to the EchoRouter.

func RegisterHandlersWithBaseURL

func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)

Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.

Types

type CreateMemoJSONRequestBody

type CreateMemoJSONRequestBody = CreateMemoRequest

CreateMemoJSONRequestBody defines body for CreateMemo for application/json ContentType.

type CreateMemoRequest

type CreateMemoRequest struct {
	Content      *string                      `json:"content,omitempty"`
	CreatedTs    *int                         `json:"createdTs,omitempty"`
	RelationList *[]UpsertMemoRelationRequest `json:"relationList,omitempty"`

	// ResourceIdList Related fields
	ResourceIdList *[]int      `json:"resourceIdList,omitempty"`
	Visibility     *Visibility `json:"visibility,omitempty"`
}

CreateMemoRequest defines model for CreateMemoRequest.

type CreateTagJSONRequestBody

type CreateTagJSONRequestBody = UpsertTagRequest

CreateTagJSONRequestBody defines body for CreateTag for application/json ContentType.

type DeleteTagJSONRequestBody

type DeleteTagJSONRequestBody = DeleteTagRequest

DeleteTagJSONRequestBody defines body for DeleteTag for application/json ContentType.

type DeleteTagRequest

type DeleteTagRequest struct {
	Name *string `json:"name,omitempty"`
}

DeleteTagRequest defines model for DeleteTagRequest.

type EchoRouter

type EchoRouter interface {
	CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}

This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration

type ListMemosParams

type ListMemosParams struct {
	// CreatorId Creator ID
	CreatorId *int `form:"creatorId,omitempty" json:"creatorId,omitempty"`

	// CreatorUsername Creator username
	CreatorUsername *string `form:"creatorUsername,omitempty" json:"creatorUsername,omitempty"`

	// RowStatus Row status
	RowStatus *ListMemosParamsRowStatus `form:"rowStatus,omitempty" json:"rowStatus,omitempty"`

	// Pinned Pinned
	Pinned *bool `form:"pinned,omitempty" json:"pinned,omitempty"`

	// Tag Search for tag. Do not append #
	Tag *string `form:"tag,omitempty" json:"tag,omitempty"`

	// Content Search for content
	Content *string `form:"content,omitempty" json:"content,omitempty"`

	// Limit Limit
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset Offset
	Offset *int `form:"offset,omitempty" json:"offset,omitempty"`
}

ListMemosParams defines parameters for ListMemos.

type ListMemosParamsRowStatus

type ListMemosParamsRowStatus string

ListMemosParamsRowStatus defines parameters for ListMemos.

const (
	ARCHIVED ListMemosParamsRowStatus = "ARCHIVED"
	NORMAL   ListMemosParamsRowStatus = "NORMAL"
)

Defines values for ListMemosParamsRowStatus.

type ListPublicMemosParams

type ListPublicMemosParams struct {
	// Limit Limit
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset Offset
	Offset *int `form:"offset,omitempty" json:"offset,omitempty"`
}

ListPublicMemosParams defines parameters for ListPublicMemos.

type ListResourcesParams

type ListResourcesParams struct {
	// Limit Limit
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset Offset
	Offset *int `form:"offset,omitempty" json:"offset,omitempty"`
}

ListResourcesParams defines parameters for ListResources.

type Memo

type Memo struct {
	// Content Domain specific fields
	Content     string  `json:"content"`
	CreatedTs   int     `json:"createdTs"`
	CreatorId   *int    `json:"creatorId,omitempty"`
	CreatorName *string `json:"creatorName,omitempty"`
	Id          int     `json:"id"`
	ParentID    *int    `json:"parentID,omitempty"`

	// Pinned Composed fields
	Pinned       *bool       `json:"pinned,omitempty"`
	ResourceList *[]Resource `json:"resourceList,omitempty"`
	RowStatus    *RowStatus  `json:"rowStatus,omitempty"`
	UpdatedTs    *int        `json:"updatedTs,omitempty"`
	Visibility   *Visibility `json:"visibility,omitempty"`
}

Memo defines model for Memo.

type MemoRelation

type MemoRelation struct {
	MemoID        *int              `json:"memoID,omitempty"`
	RelatedMemoID *int              `json:"relatedMemoID,omitempty"`
	Type          *MemoRelationType `json:"type,omitempty"`
}

MemoRelation defines model for MemoRelation.

type MemoRelationType

type MemoRelationType string

MemoRelationType defines model for MemoRelationType.

const (
	MemoRelationComment   MemoRelationType = "COMMENT"
	MemoRelationReference MemoRelationType = "REFERENCE"
)

Defines values for MemoRelationType.

type OrganizeMemoJSONRequestBody

type OrganizeMemoJSONRequestBody = UpsertMemoOrganizerRequest

OrganizeMemoJSONRequestBody defines body for OrganizeMemo for application/json ContentType.

type PatchMemoRequest

type PatchMemoRequest struct {
	// Content Domain specific fields
	Content *string `json:"content,omitempty"`

	// CreatedTs Standard fields
	CreatedTs    *int                         `json:"createdTs,omitempty"`
	RelationList *[]UpsertMemoRelationRequest `json:"relationList,omitempty"`

	// ResourceIdList Related fields
	ResourceIdList *[]int      `json:"resourceIdList,omitempty"`
	RowStatus      *RowStatus  `json:"rowStatus,omitempty"`
	UpdatedTs      *int        `json:"updatedTs,omitempty"`
	Visibility     *Visibility `json:"visibility,omitempty"`
}

PatchMemoRequest defines model for PatchMemoRequest.

type Profile

type Profile struct {
	// Mode Mode can be "prod" or "dev" or "demo"
	Mode *string `json:"mode,omitempty"`

	// Version Version is the current version of server
	Version *string `json:"version,omitempty"`
}

Profile defines model for Profile.

type Resource

type Resource struct {
	CreatedTs *int `json:"createdTs,omitempty"`

	// CreatorId Standard fields
	CreatorId    *int    `json:"creatorId,omitempty"`
	ExternalLink *string `json:"externalLink,omitempty"`

	// Filename Domain specific fields
	Filename  string  `json:"filename"`
	Id        int     `json:"id"`
	Name      *string `json:"name,omitempty"`
	Size      *int    `json:"size,omitempty"`
	Type      *string `json:"type,omitempty"`
	Uid       *string `json:"uid,omitempty"`
	UpdatedTs *int    `json:"updatedTs,omitempty"`
}

Resource defines model for Resource.

type Role

type Role string

Role defines model for Role.

const (
	RoleAdmin Role = "ADMIN"
	RoleHost  Role = "HOST"
	RoleUser  Role = "USER"
)

Defines values for Role.

type RowStatus

type RowStatus string

RowStatus defines model for RowStatus.

const (
	Archived RowStatus = "ARCHIVED"
	Normal   RowStatus = "NORMAL"
)

Defines values for RowStatus.

type ServerInterface

type ServerInterface interface {
	// Get a list of memos matching optional filters
	// (GET /api/v1/memo)
	ListMemos(ctx echo.Context, params ListMemosParams) error
	// Create a memo
	// (POST /api/v1/memo)
	CreateMemo(ctx echo.Context) error
	// Get a list of public memos matching optional filters
	// (GET /api/v1/memo/all)
	ListPublicMemos(ctx echo.Context, params ListPublicMemosParams) error
	// Delete memo by ID
	// (DELETE /api/v1/memo/{memoId})
	DeleteMemo(ctx echo.Context, memoId int) error
	// Get memo by ID
	// (GET /api/v1/memo/{memoId})
	GetMemo(ctx echo.Context, memoId int) error
	// Update a memo
	// (PATCH /api/v1/memo/{memoId})
	UpdateMemo(ctx echo.Context, memoId int) error
	// Organize memo (pin/unpin)
	// (POST /api/v1/memo/{memoId}/organizer)
	OrganizeMemo(ctx echo.Context, memoId int) error
	// Get a list of Memo Relations
	// (GET /api/v1/memo/{memoId}/relation)
	GetMemoRelations(ctx echo.Context, memoId int) error
	// Get a list of resources
	// (GET /api/v1/resource)
	ListResources(ctx echo.Context, params ListResourcesParams) error
	// Upload resource
	// (POST /api/v1/resource/blob)
	UploadResource(ctx echo.Context) error
	// Delete a resource
	// (DELETE /api/v1/resource/{resourceId})
	DeleteResource(ctx echo.Context, resourceId int) error
	// Update a resource
	// (PATCH /api/v1/resource/{resourceId})
	UpdateResource(ctx echo.Context, resourceId int) error
	// Get system GetSystemStatus
	// (GET /api/v1/status)
	GetStatus(ctx echo.Context) error
	// Get a list of tags
	// (GET /api/v1/tag)
	ListTags(ctx echo.Context) error
	// Create a tag
	// (POST /api/v1/tag)
	CreateTag(ctx echo.Context) error
	// Delete a tag
	// (POST /api/v1/tag/delete)
	DeleteTag(ctx echo.Context) error
	// Get current user
	// (GET /api/v1/user/me)
	GetCurrentUser(ctx echo.Context) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) CreateMemo

func (w *ServerInterfaceWrapper) CreateMemo(ctx echo.Context) error

CreateMemo converts echo context to params.

func (*ServerInterfaceWrapper) CreateTag

func (w *ServerInterfaceWrapper) CreateTag(ctx echo.Context) error

CreateTag converts echo context to params.

func (*ServerInterfaceWrapper) DeleteMemo

func (w *ServerInterfaceWrapper) DeleteMemo(ctx echo.Context) error

DeleteMemo converts echo context to params.

func (*ServerInterfaceWrapper) DeleteResource

func (w *ServerInterfaceWrapper) DeleteResource(ctx echo.Context) error

DeleteResource converts echo context to params.

func (*ServerInterfaceWrapper) DeleteTag

func (w *ServerInterfaceWrapper) DeleteTag(ctx echo.Context) error

DeleteTag converts echo context to params.

func (*ServerInterfaceWrapper) GetCurrentUser

func (w *ServerInterfaceWrapper) GetCurrentUser(ctx echo.Context) error

GetCurrentUser converts echo context to params.

func (*ServerInterfaceWrapper) GetMemo

func (w *ServerInterfaceWrapper) GetMemo(ctx echo.Context) error

GetMemo converts echo context to params.

func (*ServerInterfaceWrapper) GetMemoRelations

func (w *ServerInterfaceWrapper) GetMemoRelations(ctx echo.Context) error

GetMemoRelations converts echo context to params.

func (*ServerInterfaceWrapper) GetStatus

func (w *ServerInterfaceWrapper) GetStatus(ctx echo.Context) error

GetStatus converts echo context to params.

func (*ServerInterfaceWrapper) ListMemos

func (w *ServerInterfaceWrapper) ListMemos(ctx echo.Context) error

ListMemos converts echo context to params.

func (*ServerInterfaceWrapper) ListPublicMemos

func (w *ServerInterfaceWrapper) ListPublicMemos(ctx echo.Context) error

ListPublicMemos converts echo context to params.

func (*ServerInterfaceWrapper) ListResources

func (w *ServerInterfaceWrapper) ListResources(ctx echo.Context) error

ListResources converts echo context to params.

func (*ServerInterfaceWrapper) ListTags

func (w *ServerInterfaceWrapper) ListTags(ctx echo.Context) error

ListTags converts echo context to params.

func (*ServerInterfaceWrapper) OrganizeMemo

func (w *ServerInterfaceWrapper) OrganizeMemo(ctx echo.Context) error

OrganizeMemo converts echo context to params.

func (*ServerInterfaceWrapper) UpdateMemo

func (w *ServerInterfaceWrapper) UpdateMemo(ctx echo.Context) error

UpdateMemo converts echo context to params.

func (*ServerInterfaceWrapper) UpdateResource

func (w *ServerInterfaceWrapper) UpdateResource(ctx echo.Context) error

UpdateResource converts echo context to params.

func (*ServerInterfaceWrapper) UploadResource

func (w *ServerInterfaceWrapper) UploadResource(ctx echo.Context) error

UploadResource converts echo context to params.

type SystemStatus

type SystemStatus struct {
	Profile *Profile `json:"profile,omitempty"`
}

SystemStatus defines model for SystemStatus.

type UpdateMemoJSONRequestBody

type UpdateMemoJSONRequestBody = PatchMemoRequest

UpdateMemoJSONRequestBody defines body for UpdateMemo for application/json ContentType.

type UpdateResourceRequest

type UpdateResourceRequest struct {
	Filename *string `json:"filename,omitempty"`
}

UpdateResourceRequest defines model for UpdateResourceRequest.

type UploadResourceMultipartBody

type UploadResourceMultipartBody struct {
	// File File to upload
	File openapi_types.File `json:"file"`
}

UploadResourceMultipartBody defines parameters for UploadResource.

type UploadResourceMultipartRequestBody

type UploadResourceMultipartRequestBody UploadResourceMultipartBody

UploadResourceMultipartRequestBody defines body for UploadResource for multipart/form-data ContentType.

type UpsertMemoOrganizerRequest

type UpsertMemoOrganizerRequest struct {
	Pinned *bool `json:"pinned,omitempty"`
}

UpsertMemoOrganizerRequest defines model for UpsertMemoOrganizerRequest.

type UpsertMemoRelationRequest

type UpsertMemoRelationRequest struct {
	RelatedMemoId *int              `json:"relatedMemoId,omitempty"`
	Type          *MemoRelationType `json:"type,omitempty"`
}

UpsertMemoRelationRequest defines model for UpsertMemoRelationRequest.

type UpsertTagRequest

type UpsertTagRequest struct {
	Name *string `json:"name,omitempty"`
}

UpsertTagRequest defines model for UpsertTagRequest.

type User

type User struct {
	AvatarUrl *string    `json:"avatarUrl,omitempty"`
	CreatedTs *int       `json:"createdTs,omitempty"`
	Email     *string    `json:"email,omitempty"`
	Id        int        `json:"id"`
	Nickname  *string    `json:"nickname,omitempty"`
	Role      *Role      `json:"role,omitempty"`
	RowStatus *RowStatus `json:"rowStatus,omitempty"`
	UpdatedTs *int       `json:"updatedTs,omitempty"`

	// Username Domain specific fields
	Username *string `json:"username,omitempty"`
}

User defines model for User.

type Visibility

type Visibility string

Visibility defines model for Visibility.

const (
	Private   Visibility = "PRIVATE"
	Protected Visibility = "PROTECTED"
	Public    Visibility = "PUBLIC"
)

Defines values for Visibility.

Jump to

Keyboard shortcuts

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