github.com/emcfarlane/larking@v0.0.0-20220605172417-1704b45ee6c3/starlib/starlarkpubsub/pubsub.go (about) 1 // Copyright 2021 Edward McFarlane. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // Package starlarkpubsub provides methods for publishing and recieving messages. 6 package starlarkpubsub 7 8 import ( 9 "fmt" 10 11 "github.com/emcfarlane/larking/starlib/starext" 12 "go.starlark.net/starlark" 13 "go.starlark.net/starlarkstruct" 14 ) 15 16 func NewModule() *starlarkstruct.Module { 17 return &starlarkstruct.Module{ 18 Name: "pubsub", 19 Members: starlark.StringDict{ 20 "open": starext.MakeBuiltin("pubsub.open", Open), 21 }, 22 } 23 } 24 25 func Open(thread *starlark.Thread, _ string, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error) { 26 return nil, fmt.Errorf("TODO") 27 }