github.com/emcfarlane/larking@v0.0.0-20220605172417-1704b45ee6c3/examples/library/main.star (about)

     1  load("blob.star", "read_all")
     2  load("encoding/proto.star", "proto")
     3  
     4  library_bin = read_all("apipb/library.bin")
     5  print("loading library.bin")
     6  
     7  apipb = proto.file("apipb/library.proto")
     8  
     9  def get_book(req):
    10      print(req)
    11      return apipb.Book(
    12          name = req.name,
    13          title = "A book appears!",
    14          author = "starlark",
    15      )
    16  
    17  mux.register_service(
    18      "larking.examples.apipb.Library",
    19      GetBook = get_book,
    20  )