package order
import "github.com/cloudflare/redoctober/order"
Package order manages the bookkeeping and utilies required for users to create an 'order' meaning they have requested delegations for a certain resource.
Copyright (c) 2016 CloudFlare, Inc.
Index ¶
- Constants
- func GenerateNum() (num string)
- type Order
- type OrderIndex
- type Orderer
- func NewOrderer(hipchatClient hipchat.HipchatClient) (o Orderer)
- func (o *Orderer) FindOrder(user string, labels []string) (string, bool)
- func (o *Orderer) NotifyDelegation(delegator, delegatee, orderNum, duration string, labels []string)
- func (o *Orderer) NotifyNewOrder(duration, orderNum string, names, labels []string, uses int, owners map[string]string)
- func (o *Orderer) NotifyOrderFulfilled(name, orderNum string)
Constants ¶
const ( NewOrder = "%s has created an order for the label %s. requesting %d delegations for %s" NewOrderLink = "@%s - https://%s?%s" OrderFulfilled = "%s has had order %s fulfilled." NewDelegation = "%s has delegated the label %s to %s (per order %s) for %s" )
Functions ¶
func GenerateNum ¶
func GenerateNum() (num string)
Types ¶
type Order ¶
type Order struct { Creator string Users []string Num string TimeRequested time.Time DurationRequested time.Duration Delegated int OwnersDelegated []string Owners []string Labels []string }
func CreateOrder ¶
func CreateOrder(name, orderNum string, time time.Time, duration time.Duration, adminsDelegated, contacts, users, labels []string, numDelegated int) (ord Order)
type OrderIndex ¶
type Orderer ¶
type Orderer struct { Orders map[string]Order Hipchat hipchat.HipchatClient AlternateName string }
Orders represents a mapping of Order IDs to Orders. This structure is useful for looking up information about individual Orders and whether or not an order has been fulfilled. Orders that have been fulfilled will be removed from the structure.
func NewOrderer ¶
func NewOrderer(hipchatClient hipchat.HipchatClient) (o Orderer)
NewOrder will create a new map of Orders
func (*Orderer) FindOrder ¶
func (*Orderer) NotifyDelegation ¶
func (o *Orderer) NotifyDelegation(delegator, delegatee, orderNum, duration string, labels []string)
func (*Orderer) NotifyNewOrder ¶
func (o *Orderer) NotifyNewOrder(duration, orderNum string, names, labels []string, uses int, owners map[string]string)
func (*Orderer) NotifyOrderFulfilled ¶
Source Files ¶
- Version
- v0.0.0-20241112165158-ce2ad370627b (latest)
- Published
- Nov 12, 2024
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 1 day ago –
Tools for package owners.