Categorygithub.com/yunomu/blog
module
0.0.0-20241107063842-410e570117e4
Repository: https://github.com/yunomu/blog.git
Documentation: pkg.go.dev

# README

blog

Diagram

graph LR
  subgraph blog
    Article[(Article)]
    User[(User)]
    File[(File)]
    Storage[("Storage\n(Files)")]
    API[[API]]
    ArticleFunction
    UserFunction
    FileFunction
    ImageReduceFunction
    AuthClient
    GenerateFunction
    CDN[[CDN]]
  end

  Owner((Owner))
  Internet((Internet))

  Owner -- "post/update/publish" --> API
  ArticleFunction --> Article
  UserFunction --> User
  API --> ArticleFunction
  API --> UserFunction
  API --upload--> FileFunction
  API -.- AuthClient
  AuthClient ---> IDProvider
  API -- publish --> GenerateFunction
  Article --> GenerateFunction
  User --> GenerateFunction
  FileFunction --> Storage
  GenerateFunction --> Storage
  FileFunction --> File
  Storage -.- CDN
  File -.put event.-> ImageReduceFunction
  Storage --> ImageReduceFunction
  ImageReduceFunction --> Storage
  CDN -- view--- Internet

Table: User

Schema

AttrNameTypeKey
IdSHash
AttrSRange
NameS

Attributes

  • Id: User ID
  • Attr: Always Main
  • Name: Unique user name to be used in URL path

Index: NameIndex

AttrNameKey
NameHash

Table: Article

TODO

Table: File

Schema

AttrNameTypeKey
KeySHash
AttrSRange
UserIdS
NameS
CTypeS
TSN
SizeN
WN
HN
StatusS
UserIdxS

Attributes

  • Key: S3 object key. Not reused. randomized string.
  • Attr: Attributes of this object
    • Orig: Original file
    • Rep:{W}x{H}: Reduced replica
  • UserId: User ID by IDP
  • UserIdx: Same as UserId when Attr is Orig. Otherwise, empty.
  • Name: Filename
  • CType: Content Type
  • TS: Created at
  • Size: Image size(bytes)
  • W,H: Widht and height
  • Status: reserved|available|deleting|deleted

Index: UserIndex

AttrNameKey
UserIdxHash
TSRange

URL path design

  • /{User:Id}: Index
  • /{User:Id}/{Article:Id}: Article
  • /files/{File:Key}/{File:Attr}.{File:Ext}

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author